From 1a63b6af2ad6933ad6aa87da399b6a5017c70d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Greinhofer?= Date: Mon, 3 Jul 2023 00:55:45 -0500 Subject: [PATCH] Document how to exclude exceptions coming from using `assert` (#224) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the README.md file to mention the special use case when attempting to ignore `AssertionErrors` coming from the use of the `assert` keyword. Signed-off-by: Rémy Greinhofer --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 03234cb..88a7e4b 100644 --- a/README.rst +++ b/README.rst @@ -107,6 +107,13 @@ would only rerun those errors that does not match with ``AssertionError`` or ``O $ pytest --reruns 5 --rerun-except AssertionError --rerun-except OSError +.. note:: + + When the ```AssertionError``` comes from the use of the ``assert`` keyword, + use ``--rerun-except assert`` instead:: + + $ pytest --reruns 5 --rerun-except assert + Re-run individual failures --------------------------