Merge pull request #122 from wronglink/custom_scheduler_notes

Added notes about new pytest_xdist_make_scheduler hook
This commit is contained in:
Ronny Pfannschmidt
2017-02-21 12:26:59 +01:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -5,6 +5,11 @@
- Add ``worker_id`` attribute in the TestReport - Add ``worker_id`` attribute in the TestReport
- new hook: ``pytest_xdist_make_scheduler(config, log)``, can return custom tests items
distribution logic implementation. You can take a look at built-in ``LoadScheduling``
and ``EachScheduling`` implementations. Note that required scheduler class public
API may change in next ``pytest-xdist`` versions.
1.15.0 1.15.0
------ ------

View File

@@ -35,6 +35,8 @@ The execution flow is:
fashion. The rest of the tests will be distributed later as **workers** fashion. The rest of the tests will be distributed later as **workers**
finish tests (see below). finish tests (see below).
1. Note that `pytest_xdist_make_scheduler` hook can be used to implement custom tests distribution logic.
1. **workers** re-implement `pytest_runtestloop`: pytest's default implementation 1. **workers** re-implement `pytest_runtestloop`: pytest's default implementation
basically loops over all collected items in the `session` object and executes basically loops over all collected items in the `session` object and executes
the `pytest_runtest_protocol` for each test item, but in xdist **workers** sit idly the `pytest_runtest_protocol` for each test item, but in xdist **workers** sit idly