From 64d78c5e7331c9407d53de2e5063cdec7d518c94 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Fri, 14 Jan 2022 16:22:40 -0600 Subject: [PATCH] [CI] Issue directions to install pytest when missing --- test/python/runCythonTests.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/python/runCythonTests.py b/test/python/runCythonTests.py index b9867fb7ffb..4286626a2a4 100644 --- a/test/python/runCythonTests.py +++ b/test/python/runCythonTests.py @@ -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 Python test suite requires " + "the Python module '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__}")