Use pytest_xdist_make_scheduler hook to set up scheduller instance

This commit is contained in:
Michael Elovskikh
2016-10-10 19:33:14 +05:00
parent 3165b78936
commit 2ff2772521
4 changed files with 20 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ must be taken in plugins in case ``xdist`` is not installed. Please see:
http://pytest.org/latest/writing_plugins.html#optionally-using-hooks-from-3rd-party-plugins
"""
import pytest
def pytest_xdist_setupnodes(config, specs):
@@ -44,3 +45,9 @@ def pytest_testnodedown(node, error):
def pytest_xdist_node_collection_finished(node, ids):
"""called by the master node when a node finishes collecting.
"""
@pytest.hookspec(firstresult=True)
def pytest_xdist_make_scheduler(numnodes, log, config):
"""Return a node scheduler implementation, or None.
"""