File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments