Skip to content

Commit f86de60

Browse files
committed
Minor documentation updates
1 parent 8d43f0e commit f86de60

File tree

4 files changed

+58
-39
lines changed

4 files changed

+58
-39
lines changed

README.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,29 @@ _pytest-order_ - a pytest plugin to order test execution
55

66
`pytest-order` is a pytest plugin that allows you to customize the order in which
77
your tests are run. It uses the marker `order` that defines when a specific
8-
test shall be run relative to the other tests.
8+
test shall be run relative to the other tests.
9+
10+
`pytest-order` is a fork of
11+
[pytest-ordering](https://github.com/ftobia/pytest-ordering) that provides
12+
some additional features--see [below](#comparison-with-pytest_ordering) for
13+
details.
914

1015
`pytest-order` works with Python 2.7 and 3.5 - 3.9, with pytest
1116
versions >= 3.7.0, and runs on Linux, MacOs and Windows.
1217

13-
1418
Documentation
1519
-------------
1620
Apart from this overview, the following information is available:
1721
- usage documentation for the [latest release](https://mrbean-bremen.github.io/pytest-order/stable/)
1822
- usage documentation for the [current master](https://mrbean-bremen.github.io/pytest-order/dev/)
1923
- the [Release Notes](https://github.com/mrbean-bremen/pytest-order/blob/master/CHANGELOG.md)
2024
with a list of changes in the latest versions
21-
22-
History
23-
-------
24-
This is a fork of [pytest-ordering](https://github.com/ftobia/pytest-ordering).
25-
That project is not maintained anymore, and there are several helpful PRs
26-
that are now integrated into `pytest-order`. The idea and most of the code
27-
has been created by Frank Tobia, the author of that plugin, and
28-
[contributors](https://github.com/mrbean-bremen/pytest-order/blob/master/AUTHORS).
29-
30-
Compatibility with pytest_ordering
31-
----------------------------------
32-
`pytest-order` is **not** compatible with `pytest-ordering` due to the
33-
changed marker name (`order` instead of `run`). Only the `order`
34-
marker is supported, support for all additional markers has been removed for
35-
consistence (as has been discussed in
36-
[this issue](https://github.com/ftobia/pytest-ordering/issues/38)).
25+
- a [list of open issues](https://github.com/mrbean-bremen/pytest-order/blob/master/old_issues.md)
26+
in the original project and their handling in `pytest-order`
3727

3828
Overview
3929
--------
40-
_(from the original project)_
30+
_(adapted from the original project)_
4131

4232
Have you ever wanted to easily run one of your tests before any others run?
4333
Or run some tests last? Or run this one test before that other test? Or
@@ -76,3 +66,31 @@ yields the output:
7666
test_foo.py:3: test_foo PASSED
7767

7868
=========================== 2 passed in 0.01 seconds ===========================
69+
70+
History
71+
-------
72+
This is a fork of [pytest-ordering](https://github.com/ftobia/pytest-ordering).
73+
That project is not maintained anymore, and there are several helpful PRs
74+
that are now integrated into `pytest-order`. The idea and most of the code
75+
has been created by Frank Tobia, the author of that plugin, and
76+
[contributors](https://github.com/mrbean-bremen/pytest-order/blob/master/AUTHORS).
77+
78+
Comparison with pytest_ordering
79+
-------------------------------
80+
While derived from `pytest_ordering`, `pytest-order` is **not** compatible
81+
with `pytest-ordering` due to the changed marker name (`order` instead of
82+
`run`). Additional markers are integrated into the `order` marker (for a
83+
rationale see also
84+
[this issue](https://github.com/ftobia/pytest-ordering/issues/38)).
85+
86+
Apart from the changed marker name, there is a number of features not
87+
implemented in the released version of `pytest-ordering`:
88+
- support for ordering tests relative to each other
89+
- support for module and class-scope ordering via a config option
90+
- optional support for ordering tests with `pytest-dependency` markers
91+
- optional support for sparse ordering
92+
- optional invocation of the plugin before (instead of after) other plugins
93+
94+
Most of these features are derived from [issues](https://github.com/mrbean-bremen/pytest-order/blob/master/old_issues.md)
95+
and pull requests in `pytest-ordering`. A description of each feature can be
96+
found in the [documentation](https://mrbean-bremen.github.io/pytest-order/dev/).

docs/source/index.rst

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ By default, tests with no ``order`` mark are executed after all tests with
245245
positive ordinal numbers (or the respective names), and before tests with
246246
negative ordinal numbers. The order of these tests in relationship to each
247247
other is not changed. This behavior may slightly change if the option
248-
:ref:`sparse-ordering` is used and the ordinals are not contiguous (see
249-
below).
248+
:ref:`sparse-ordering` is used and the ordinals are not contiguous.
250249

251250

252251
Order relative to other tests
@@ -341,7 +340,7 @@ The `pytest-dependency <https://pypi.org/project/pytest-dependency/>`__
341340
plugin also manages dependencies between tests (skips tests that depend
342341
on skipped or failed tests), but currently doesn't do any ordering. If you
343342
want to execute the tests in a specific order to each other, you can use
344-
``pytest-ordering``. If you want to skip or xfail tests dependent on other
343+
``pytest-order``. If you want to skip or xfail tests dependent on other
345344
tests you can use ``pytest-dependency``. If you want to have both behaviors
346345
combined, you can use both plugins together with the
347346
option :ref:`order-dependencies`--see below for more information.
@@ -352,23 +351,6 @@ There are a few command line options that change the behavior of the
352351
plugin. As with any pytest option, you can add the options to your
353352
``pytest.ini`` if you want to have them applied to all tests automatically.
354353

355-
``--indulgent-ordering``
356-
------------------------
357-
You may sometimes find that you want to suggest an ordering of tests, while
358-
allowing it to be overridden for good reason. For example, if you run your test
359-
suite in parallel and have a number of tests which are particularly slow, it
360-
might be desirable to start those tests running first, in order to optimize
361-
your completion time. You can use the ``pytest-order`` plugin to inform pytest
362-
of this.
363-
364-
Now suppose you also want to prioritize tests which failed during the
365-
previous run, by using the ``--failed-first`` option. By default,
366-
pytest-order will override the ``--failed-first`` order, but by adding the
367-
``--indulgent-ordering`` option, you can ask pytest to run the sort from
368-
pytest-order *before* the sort from ``--failed-first``, allowing the failed
369-
tests to be sorted to the front (note that in pytest versions from 6.0 on,
370-
this seems not to be needed anymore, at least in this specific case).
371-
372354
.. _order-scope:
373355

374356
``--order-scope``
@@ -389,6 +371,23 @@ separate test functions, these test functions are handled separately from the
389371
test classes. If a module has no test classes, the effect is the same as
390372
if using ``--order-scope=module``.
391373

374+
``--indulgent-ordering``
375+
------------------------
376+
You may sometimes find that you want to suggest an ordering of tests, while
377+
allowing it to be overridden for good reason. For example, if you run your test
378+
suite in parallel and have a number of tests which are particularly slow, it
379+
might be desirable to start those tests running first, in order to optimize
380+
your completion time. You can use the ``pytest-order`` plugin to inform pytest
381+
of this.
382+
383+
Now suppose you also want to prioritize tests which failed during the
384+
previous run, by using the ``--failed-first`` option. By default,
385+
pytest-order will override the ``--failed-first`` order, but by adding the
386+
``--indulgent-ordering`` option, you can ask pytest to run the sort from
387+
pytest-order *before* the sort from ``--failed-first``, allowing the failed
388+
tests to be sorted to the front (note that in pytest versions from 6.0 on,
389+
this seems not to be needed anymore, at least in this specific case).
390+
392391
.. _sparse-ordering:
393392

394393
``--sparse-ordering``

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[metadata]
22
description-file = README.md
3+
license_files = LICENSE
34
[bdist_wheel]
45
universal=1

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
author_email="[email protected]",
2222
url="https://github.com/mrbean-bremen/pytest-order",
2323
packages=["pytest_order"],
24+
license="MIT",
2425
entry_points={
2526
"pytest11": [
2627
"pytest_order = pytest_order",

0 commit comments

Comments
 (0)