diff --git a/agbenchmark/conftest.py b/agbenchmark/conftest.py index b91b5f9f..32151b8a 100644 --- a/agbenchmark/conftest.py +++ b/agbenchmark/conftest.py @@ -85,6 +85,7 @@ def pytest_addoption(parser: Any) -> None: parser.addoption("--mock", action="store_true", default=False) parser.addoption("--improve", action="store_true", default=False) parser.addoption("--maintain", action="store_true", default=False) + parser.addoption("--test", action="store_true", default=None) @pytest.fixture(autouse=True) @@ -232,6 +233,8 @@ def pytest_collection_modifyitems(items: Any, config: Any) -> None: # Filter dependencies if they exist in regression data if its an improvement test if config.getoption("--improve"): dependencies = [dep for dep in dependencies if not data.get(dep, None)] + elif config.getoption("--test"): + dependencies = [] categories = test_class_instance.data.category diff --git a/agbenchmark/start_benchmark.py b/agbenchmark/start_benchmark.py index 917cd4e8..ab2586e6 100644 --- a/agbenchmark/start_benchmark.py +++ b/agbenchmark/start_benchmark.py @@ -94,7 +94,7 @@ def start(category: str, test: str, maintain: bool, improve: bool, mock: bool) - pytest_args = ["-vs"] if test: print("Running specific test:", test) - pytest_args.extend(["-k", test]) + pytest_args.extend(["-k", test, "--test"]) else: if category: pytest_args.extend(["-m", category])