File tree Expand file tree Collapse file tree 9 files changed +220
-148
lines changed Expand file tree Collapse file tree 9 files changed +220
-148
lines changed Original file line number Diff line number Diff line change 1+ pytest-xdist 3.ZZZ.ZZZ (2024-zz-zz)
2+ ===============================
3+
4+ Features
5+ --------
6+ - `#1126 <https://github.com/pytest-dev/pytest-xdist/pull/1126 >`_: New ``isoscope `` scheduler.
7+
18pytest-xdist 3.6.1 (2024-04-28)
29===============================
310
Original file line number Diff line number Diff line change @@ -49,6 +49,19 @@ The test distribution algorithm is configured with the ``--dist`` command-line o
4949
5050.. _distribution modes :
5151
52+ * ``--dist isoscope ``: Scope Isolation Scheduler. Tests are grouped by module for
53+ test functions and by class for test methods. Tests are executed one group at a
54+ time, distributed across available workers. This groupwise isolation guarantees
55+ that all tests in one group complete execution before running another group of
56+ tests. This can be useful when module-level or class-level fixtures of one group
57+ could create undesirable side-effects for tests in other test groups, while
58+ taking advantage of distributed execution of tests within each group. Grouping
59+ by class takes priority over grouping by module. NOTE: the use of this scheduler
60+ requires distributed coordination for setup and teardown such as provided by
61+ the ``iso_scheduling `` fixture or an alternate implementation of distributed
62+ coordination - see the ``iso_scheduling.coordinate_setup_teardown `` usage example
63+ in iso_scheduling_plugin.py.
64+
5265* ``--dist load `` **(default) **: Sends pending tests to any worker that is
5366 available, without any guaranteed order. Scheduling can be fine-tuned with
5467 the `--maxschedchunk ` option, see output of `pytest --help `.
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ classifiers = [
3434requires-python = " >=3.8"
3535dependencies = [
3636 " execnet>=2.1" ,
37+ " filelock>=3.13.1" ,
3738 " pytest>=7.0.0" ,
3839]
3940dynamic = [" version" ]
@@ -47,6 +48,7 @@ Tracker = "https://github.com/pytest-dev/pytest-xdist/issues"
4748
4849[project .entry-points .pytest11 ]
4950xdist = " xdist.plugin"
51+ "xdist.iso_scheduling_plugin" = " xdist.iso_scheduling_plugin"
5052"xdist.looponfail" = " xdist.looponfail"
5153
5254[project .optional-dependencies ]
Original file line number Diff line number Diff line change 1515from xdist .remote import Producer
1616from xdist .remote import WorkerInfo
1717from xdist .scheduler import EachScheduling
18+ from xdist .scheduler import IsoScopeScheduling
1819from xdist .scheduler import LoadFileScheduling
1920from xdist .scheduler import LoadGroupScheduling
2021from xdist .scheduler import LoadScheduling
@@ -113,6 +114,8 @@ def pytest_xdist_make_scheduler(
113114 dist = config .getvalue ("dist" )
114115 if dist == "each" :
115116 return EachScheduling (config , log )
117+ if dist == "isoscope" :
118+ return IsoScopeScheduling (config , log )
116119 if dist == "load" :
117120 return LoadScheduling (config , log )
118121 if dist == "loadscope" :
You can’t perform that action at this time.
0 commit comments