File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -335,22 +335,23 @@ def pytest_configure(config: pytest.Config) -> None:
335335def pytest_collection_modifyitems (
336336 config : pytest .Config , items : list [pytest .Item ]
337337) -> None :
338- if config .getoption ("--run-api-tests" ):
339- return
340- if config .getoption ("--run-cluster-tests" ):
341- return
338+ # Check each flag independently
339+ run_api_tests = config .getoption ("--run-api-tests" )
340+ run_cluster_tests = config .getoption ("--run-cluster-tests" )
342341
343- # Otherwise skip all tests requiring an API key
342+ # Create skip markers
344343 skip_api = pytest .mark .skip (
345344 reason = "Skipping test because API keys are not provided. Use --run-api-tests to run these tests."
346345 )
347346 skip_cluster = pytest .mark .skip (
348347 reason = "Skipping test because Redis cluster is not available. Use --run-cluster-tests to run these tests."
349348 )
349+
350+ # Apply skip markers independently based on flags
350351 for item in items :
351- if item .get_closest_marker ("requires_api_keys" ):
352+ if item .get_closest_marker ("requires_api_keys" ) and not run_api_tests :
352353 item .add_marker (skip_api )
353- if item .get_closest_marker ("requires_cluster" ):
354+ if item .get_closest_marker ("requires_cluster" ) and not run_cluster_tests :
354355 item .add_marker (skip_cluster )
355356
356357
You can’t perform that action at this time.
0 commit comments