File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -55,19 +55,22 @@ def pytest_addoption(parser):
55
55
"--run-api-tests" ,
56
56
action = "store_true" ,
57
57
default = False ,
58
- help = "Run tests that require API keys"
58
+ help = "Run tests that require API keys" ,
59
59
)
60
60
61
+
61
62
def pytest_configure (config ):
62
63
config .addinivalue_line (
63
- "markers" ,
64
- "requires_api_keys: mark test as requiring API keys"
64
+ "markers" , "requires_api_keys: mark test as requiring API keys"
65
65
)
66
66
67
+
67
68
def pytest_collection_modifyitems (config , items ):
68
69
if config .getoption ("--run-api-tests" ):
69
70
return
70
- skip_api = pytest .mark .skip (reason = "Skipping test because API keys are not provided. Use --run-api-tests to run these tests." )
71
+ skip_api = pytest .mark .skip (
72
+ reason = "Skipping test because API keys are not provided. Use --run-api-tests to run these tests."
73
+ )
71
74
for item in items :
72
75
if item .get_closest_marker ("requires_api_keys" ):
73
76
item .add_marker (skip_api )
You can’t perform that action at this time.
0 commit comments