Skip to content

Commit

Permalink
[test] refactor catching missing packages
Browse files Browse the repository at this point in the history
to make sure it's an error for us if these are missing in CI
  • Loading branch information
renefritze committed Jul 16, 2020
1 parent b1cbd13 commit 0b0c994
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/pymortests/demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,13 @@ def nop(*args, **kwargs):
result = None
try:
result = demo()
except QtMissing:
pytest.xfail("Qt missing")
except GmshMissing:
pytest.xfail(f'Gmsh not intalled')
except MeshioMissing:
pytest.xfail(f'meshio not intalled')
except TorchMissing:
pytest.xfail(f'torch not installed')
except (QtMissing, GmshMissing, MeshioMissing, TorchMissing) as e:
if os.environ.get('DOCKER_PYMOR', False):
# these are all installed in our CI env so them missing a grave error
raise e
else:
miss = str(type(e)).replace('Missing', '')
pytest.xfail(f'{miss} not installed')
finally:
stop_gui_processes()

Expand Down

0 comments on commit 0b0c994

Please sign in to comment.