Skip to content

Commit

Permalink
test_prog.py: if versions of program and module differ, print a note
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Oct 13, 2024
1 parent 7ab58c8 commit 670e977
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_prog.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def has_gemmi():
'\n returncode:', e.returncode)
return False
assert v.startswith(b'gemmi 0.')
return gemmi is None or v.split()[1].decode() == gemmi.__version__
prog_ver = v.split()[1].decode()
if gemmi and gemmi.__version__ != prog_ver:
print(f'NOTE: gemmi {prog_ver} in $PATH mismatches',
f'gemmi module {gemmi.__version__}. Skipping.')
return False
return True

@unittest.skipIf(not has_gemmi(), "Program gemmi not found.")
class TestProg(unittest.TestCase):
Expand Down

0 comments on commit 670e977

Please sign in to comment.