From 4a7b159626531e79460285fe3d7d83c8062317da Mon Sep 17 00:00:00 2001 From: albrja Date: Fri, 22 Sep 2023 12:30:46 -0700 Subject: [PATCH] Add runslow to conftest so deploy will work --- tests/conftest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 19cb6c4c..c160cf50 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,6 +12,24 @@ from vivarium.testing_utilities import metadata +def pytest_addoption(parser): + parser.addoption("--runslow", action="store_true", default=False, help="run slow tests") + + +def pytest_configure(config): + config.addinivalue_line("markers", "slow: mark test as slow to run") + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--runslow"): + # --runslow given in cli: do not skip slow tests + return + skip_slow = pytest.mark.skip(reason="need --runslow option to run") + for item in items: + if "slow" in item.keywords: + item.add_marker(skip_slow) + + @pytest.fixture def caplog(caplog: LogCaptureFixture): handler_id = logger.add(caplog.handler, format="{message}")