Skip to content

Commit 59332da

Browse files
authored
Merge pull request #12 from jbasko/dev
Docs
2 parents f62683c + 8643f9d commit 59332da

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pytest-random-order
55
:target: https://travis-ci.org/jbasko/pytest-random-order
66

77
pytest-random-order is a plugin for `pytest <http://pytest.org>`_ that randomises the order in which
8-
tests are run to reveal unwanted coupling between tests. It allows user to control the level
8+
tests are run to reveal unwanted coupling between tests. The plugin user to control the level
99
of randomness they want to introduce and to disable reordering on subsets of tests.
1010
Tests can be rerun in a specific order by passing a seed value reported in a previous test run.
1111

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
# built documents.
5858
#
5959
# The short X.Y version.
60-
version = '0.5.0'
60+
version = '0.5.2'
6161
# The full version, including alpha/beta/rc tags.
62-
release = 'v0.5.0'
62+
release = 'v0.5.2'
6363

6464
# The language for content autogenerated by Sphinx. Refer to documentation
6565
# for a list of supported languages.

docs/index.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Welcome to pytest-random-order
55
pytest-random-order is a plugin for `pytest <http://pytest.org>`_ that randomises the order in which
66
tests are run to reveal unwanted coupling between tests. The plugin allows user to control the level
77
of randomness they want to introduce and to disable reordering on subsets of tests.
8+
Tests can be rerun in a specific order by passing a seed value reported in a previous test run.
89

910
.. toctree::
1011
:maxdepth: 2
@@ -37,6 +38,13 @@ To disable reordering of tests in a module or class, use pytest marker notation:
3738

3839
pytestmark = pytest.mark.random_order(disabled=True)
3940

41+
To rerun tests in a particular order:
42+
43+
::
44+
45+
$ pytest -v --random-order-seed=<value-reported-in-previous-run>
46+
47+
4048
Design
4149
------
4250

@@ -118,6 +126,28 @@ No matter what will be the bucket type for the test run, ``test_number_one`` wil
118126
before ``test_number_two``.
119127

120128

129+
Rerun Tests in the Same Order (Same Seed)
130+
+++++++++++++++++++++++++++++++++++++++++
131+
132+
If you discover a failing test because you reordered tests, you will probably want to be able to rerun the tests
133+
in the same failing order. To allow reproducing test order, the plugin reports the seed value it used with pseudo random number
134+
generator:
135+
136+
::
137+
138+
============================= test session starts ==============================
139+
..
140+
Using --random-order-bucket=module
141+
Using --random-order-seed=24775
142+
...
143+
144+
You can now the ``--random-order-seed=...`` bit as an argument to the next run to produce the same order:
145+
146+
::
147+
148+
$ pytest -v --random-order-seed=24775
149+
150+
121151
Disable the Plugin
122152
++++++++++++++++++
123153

0 commit comments

Comments
 (0)