From 9e38d96a9320ee7e9ecaa976b2fc70a1acbd14f4 Mon Sep 17 00:00:00 2001 From: awais-ur-rehman Date: Thu, 29 Oct 2026 08:55:36 +0500 Subject: [PATCH] docs: clarify doctest repetition limits --- README.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f89bb8a3..85c5ebcc 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,11 @@ your test, or tests, to be run: $ pytest --count=10 test_file.py -Each test collected by pytest will be run :code:`count` times. +Each pytest test function will be run :code:`count` times. + +Doctests are not repeated. Doctests collected from Python modules with +:code:`--doctest-modules` or from text files run once, regardless of +:code:`--count`. If you want to mark a test in your code to be repeated a number of times, you can use the :code:`@pytest.mark.repeat(count)` decorator: