Skip to content

Commit 5c4fe2a

Browse files
Konstantin Baikovphilpep
authored andcommitted
Remove PytestDeprecationWarning about config opts
Pytest has deprecated markers for hooks configuration. See: https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers Each envocation of pytest with python warning enabled would produce the following message: PytestDeprecationWarning: The hookimpl pytest_configure uses old-style configuration options (marks or attributes). Please use the pytest.hookimpl(trylast=True) decorator instead This commit fixes that issue.
1 parent 8e20569 commit 5c4fe2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testinfra/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def write(self, s):
189189
return super().write(s)
190190

191191

192-
@pytest.mark.trylast
192+
@pytest.hookimpl(trylast=True)
193193
def pytest_configure(config):
194194
if config.getoption("--verbose", 0) > 1:
195195
root = logging.getLogger()
@@ -207,7 +207,7 @@ def pytest_configure(config):
207207
config.pluginmanager.register(NagiosReporter(out), "nagiosreporter")
208208

209209

210-
@pytest.mark.trylast
210+
@pytest.hookimpl(trylast=True)
211211
def pytest_sessionfinish(session, exitstatus):
212212
reporter = session.config.pluginmanager.getplugin("nagiosreporter")
213213
if reporter:

0 commit comments

Comments
 (0)