Skip to content

Commit

Permalink
[CI] Issue directions to install pytest when missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Jan 15, 2022
1 parent 18f40cd commit f07ea4c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/python/runCythonTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,22 @@
CANTERA_ROOT = Path(__file__).parents[2]
os.chdir(str(CANTERA_ROOT / "test" / "work"))

import pytest
try:
import pytest
except ImportError:
pytest = None
import cantera
import cantera.test


if __name__ == "__main__":
if pytest is None:
print("\n* ERROR: The Cantera Python test suite requires "
"the Python package 'pytest'.")
print("* ERROR: Use pip or conda to install 'pytest', "
"which will enable this feature.")
sys.exit(1)

print("\n* INFO: using Cantera module found at this location:")
print(f"* '{cantera.__file__}'")
print(f"* INFO: Cantera version: {cantera.__version__}")
Expand Down

0 comments on commit f07ea4c

Please sign in to comment.