@@ -38,7 +38,7 @@ ordering, all configuration options) that are not available in
38
38
39
39
Supported Python and pytest versions
40
40
------------------------------------
41
- ``pytest-order `` supports python 2.7, 3.5 - 3.9 , and pypy/pypy3, and is
41
+ ``pytest-order `` supports python 2.7, 3.5 - 3.10 , and pypy/pypy3, and is
42
42
compatible with pytest 3.7.0 or newer. Note that support for Python 2 will
43
43
be removed in one of the next versions.
44
44
@@ -460,7 +460,7 @@ regardless of the ordinal markers.
460
460
Several relationships for the same marker
461
461
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
462
462
If you need to order a certain test relative to more than one other test, you
463
- can add more than one test name to the ``before `` or ``after marker
463
+ can add more than one test name to the ``before `` or ``after `` marker
464
464
attributes, separated by spaces:
465
465
466
466
.. code :: python
@@ -1016,7 +1016,7 @@ Using pytest-order with other pytest plugins
1016
1016
1017
1017
Relationship with pytest-dependency
1018
1018
-----------------------------------
1019
- The `pytest-dependency < https://pypi.org/project/pytest-dependency/ >`__
1019
+ The `pytest-dependency `_
1020
1020
plugin also manages dependencies between tests (skips tests that depend
1021
1021
on skipped or failed tests), but currently doesn't do any ordering. If you
1022
1022
want to execute the tests in a specific order to each other, you can use
@@ -1025,11 +1025,11 @@ tests you can use ``pytest-dependency``. If you want to have both behaviors
1025
1025
combined, you can use both plugins together with the
1026
1026
option :ref: `order-dependencies `, described above.
1027
1027
1028
- Using together with pytest-randomly
1029
- -----------------------------------
1028
+ Usage with other ordering plugins
1029
+ ---------------------------------
1030
1030
There is a number of other pytest plugins that change the order in which tests
1031
1031
are executed, the most widely known probably being
1032
- `pytest-randomly < https://pypi.org/project/pytest-randomly/ >`__ , which
1032
+ `pytest-randomly `_ , which
1033
1033
executes tests in a random order to avoid unknown test dependencies.
1034
1034
``pytest-order `` should still work with these as long as it is executed
1035
1035
*after * the other plugins (which it should by default, except if you use
@@ -1080,10 +1080,17 @@ The same is true for relative ordering. The tests will be correctly ordered
1080
1080
before and after the tests as configured, but all other tests will be in an
1081
1081
arbitrary order.
1082
1082
1083
+ Note that it does not make much sense to use ordering plugins together that
1084
+ have a similar goal as ``pytest-order ``, as for example ``pytest-ordering ``.
1085
+ As mentioned, both plugins can co-exist without problems due to the
1086
+ different marker names, but using markers of both plugins in the same test
1087
+ run is not recommended. One plugin may partially revert the effects of the
1088
+ other plugin in unpredictable ways. The same is true for other plugins that
1089
+ define the test order.
1083
1090
1084
1091
Usage with pytest-xdist
1085
1092
-----------------------
1086
- The `pytest-xdist < https://pypi.org/project/pytest-xdist/ >`__ plugin
1093
+ The `pytest-xdist `_ plugin
1087
1094
schedules tests unordered, and the order configured by ``pytest-order ``
1088
1095
will normally not be preserved. But if we use the ``--dist=loadfile ``
1089
1096
option, provided by ``xdist ``, all tests from one file will be run in the
@@ -1094,3 +1101,8 @@ each group of dependent tests in one file, and call pytest with
1094
1101
1095
1102
.. toctree ::
1096
1103
:maxdepth: 2
1104
+
1105
+
1106
+ .. _`pytest-xdist` : https://pypi.org/project/pytest-xdist/
1107
+ .. _`pytest-randomly` : https://pypi.org/project/pytest-randomly/
1108
+ .. _`pytest-dependency` : https://pypi.org/project/pytest-dependency/
0 commit comments