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):
5555 "--run-api-tests" ,
5656 action = "store_true" ,
5757 default = False ,
58- help = "Run tests that require API keys"
58+ help = "Run tests that require API keys" ,
5959 )
6060
61+
6162def pytest_configure (config ):
6263 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"
6565 )
6666
67+
6768def pytest_collection_modifyitems (config , items ):
6869 if config .getoption ("--run-api-tests" ):
6970 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+ )
7174 for item in items :
7275 if item .get_closest_marker ("requires_api_keys" ):
7376 item .add_marker (skip_api )
You can’t perform that action at this time.
0 commit comments