Merge pull request #728 from bluetech/hookimpl-decorators

Add explicit pytest.hookspec/hookimpl annotations, avoid legacy tryfirst/trylast marks
This commit is contained in:
Ran Benita
2021-11-02 12:28:36 +02:00
committed by GitHub
7 changed files with 40 additions and 6 deletions

View File

@@ -205,7 +205,7 @@ class TestDistribution:
def pytest_addoption(parser):
parser.addoption("--foobar", action="store", dest="foobar_opt")
@pytest.mark.tryfirst
@pytest.hookimpl(tryfirst=True)
def pytest_load_initial_conftests(early_config):
opt = early_config.known_args_namespace.foobar_opt
print("--foobar=%s active! [%s]" % (opt, os.getpid()), file=sys.stderr)