Skip to content

Commit dd83dfe

Browse files
authored
Update README.rst
1 parent 0462399 commit dd83dfe

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ test re-run is launched:
5555
5656
$ pytest --reruns 5 --reruns-delay 1
5757
58+
Re-run all failures matching certain expressions
59+
------------------------------------------------
60+
61+
To re-run only those failures that match a certain list of expressions, use the
62+
``--only-rerun`` flag and pass it a regular expression. For example, the following would
63+
only rerun those errors that match ``AssertionError``:
64+
65+
.. code-block:: bash
66+
67+
$ pytest --reruns 5 --only-rerun AssertionError
68+
69+
Passing the flag multiple times accumulates the arguments, so the following would only rerun
70+
those errors that match ``AssertionError`` or ``ValueError``:
71+
72+
.. code-block:: bash
73+
74+
$ pytest --reruns 5 --only-rerun AssertionError --only-rerun ValueError
75+
5876
Re-run individual failures
5977
--------------------------
6078

0 commit comments

Comments
 (0)