From bb170bfbe52475ed0d0f8b179d013e4ff1398b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 11 Jun 2020 12:33:00 -0300 Subject: [PATCH] Fix integration tests skip condition --- tardis/conftest.py | 5 +++++ tardis/tests/integration_tests/test_integration.py | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tardis/conftest.py b/tardis/conftest.py index 3028372a815..22c41be13a3 100644 --- a/tardis/conftest.py +++ b/tardis/conftest.py @@ -155,6 +155,11 @@ def tardis_ref_path(): else: return os.path.expandvars(os.path.expanduser(tardis_ref_path)) +@pytest.fixture(scope='session') +def integration_tests(): + if not pytest.config.getvalue('integration-tests'): + pytest.skip('integration tests are not included in this run') + from tardis.tests.fixtures.atom_data import * @pytest.yield_fixture(scope="session") diff --git a/tardis/tests/integration_tests/test_integration.py b/tardis/tests/integration_tests/test_integration.py index 82c1d0407bc..272b1188a37 100644 --- a/tardis/tests/integration_tests/test_integration.py +++ b/tardis/tests/integration_tests/test_integration.py @@ -58,8 +58,6 @@ def model_quantities(request): return request.param -@pytest.mark.skipif(not pytest.config.getvalue("integration-tests"), - reason="integration tests are not included in this run") @pytest.mark.integration class TestIntegration(object): """Slow integration test for various setups present in subdirectories of @@ -68,7 +66,7 @@ class TestIntegration(object): @classmethod @pytest.fixture(scope="class", autouse=True) - def setup(self, request, reference, data_path, pytestconfig): + def setup(self, request, reference, data_path, pytestconfig, integration_tests): """ This method does initial setup of creating configuration and performing a single run of integration test.