4
def pytest_addoption(parser):
5
group = parser.getgroup("debugconfig")
6
group.addoption('--setupplan', '--setup-plan', action="store_true",
7
help="show what fixtures and tests would be executed but "
8
"don't execute anything.")
11
@pytest.hookimpl(tryfirst=True)
12
def pytest_fixture_setup(fixturedef, request):
13
# Will return a dummy fixture if the setuponly option is provided.
14
if request.config.option.setupplan:
15
fixturedef.cached_result = (None, None, None)
16
return fixturedef.cached_result
19
@pytest.hookimpl(tryfirst=True)
20
def pytest_cmdline_main(config):
21
if config.option.setupplan:
22
config.option.setuponly = True
23
config.option.setupshow = True