Skip to content

Commit

Permalink
Use modern options configurations for hooks
Browse files Browse the repository at this point in the history
Noticed while reviewing pytest-dev/pytest#9118
  • Loading branch information
nicoddemus committed Sep 24, 2021
1 parent 56275d4 commit da606e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xdist/newhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit da606e7

Please sign in to comment.