Merge pull request #708 from nicoddemus/use-modern-hook-opts

This commit is contained in:
Bruno Oliveira
2021-09-24 10:18:39 -03:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -0,0 +1 @@
Use ``@pytest.hookspec`` decorator to declare hook options in ``newhooks.py`` to avoid warnings in ``pytest 7.0``.

View File

@@ -30,7 +30,7 @@ def pytest_xdist_rsyncfinish(source, gateways):
"""called after rsyncing a directory to remote gateways takes place."""
@pytest.mark.firstresult
@pytest.hookspec(firstresult=True)
def pytest_xdist_getremotemodule():
"""called when creating remote node"""
@@ -51,12 +51,12 @@ def pytest_xdist_node_collection_finished(node, ids):
"""called by the controller node when a worker node finishes collecting."""
@pytest.mark.firstresult
@pytest.hookspec(firstresult=True)
def pytest_xdist_make_scheduler(config, log):
"""return a node scheduler implementation"""
@pytest.mark.firstresult
@pytest.hookspec(firstresult=True)
def pytest_xdist_auto_num_workers(config):
"""
Return the number of workers to spawn when ``--numprocesses=auto`` is given in the
@@ -66,7 +66,7 @@ def pytest_xdist_auto_num_workers(config):
"""
@pytest.mark.firstresult
@pytest.hookspec(firstresult=True)
def pytest_handlecrashitem(crashitem, report, sched):
"""
Handle a crashitem, modifying the report if necessary.