mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-08 08:44:23 +01:00
Remove dependencies if a specific test is asked by the user (#95)
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user