Skip to content

Commit 0b9001f

Browse files
gh-1463: testing: Expand refleak checker section (GH-1468)
1 parent d0661a5 commit 0b9001f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Diff for: testing/run-write-tests.rst

+15-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,21 @@ if the failures are transient or consistent.
200200
The ``-uall`` flag allows the use of all available
201201
resources so as to not skip tests requiring, for example, Internet access.
202202

203-
To check for reference leaks (only needed if you modified C code), use the
204-
``-R`` flag. For example, ``-R 3:2`` will first run the test 3 times to settle
205-
down the reference count, and then run it 2 more times to verify if there are
206-
any leaks.
203+
To check for reference leaks (only needed if you modified C code),
204+
you can enable reference leak checking during testing using the ``-R`` flag.
205+
For example, using the command::
206+
207+
python -m test <test_name> -R :
208+
209+
This default setting performs a few initial warm-up runs to stabilize the reference count,
210+
followed by additional runs to check for leaks.
211+
212+
If you want more control over the number of runs, you can specify ``warmups`` and ``repeats`` explicitly::
213+
214+
python -m test <test_name> -R <warmups>:<repeats>
215+
216+
For instance, ``-R 3:2`` will first run the test 3 times to settle down the
217+
reference count, and then run it 2 more times to check for leaks.
207218

208219
You can also execute the ``Tools/scripts/run_tests.py`` script as found in a
209220
CPython checkout. The script tries to balance speed with thoroughness. But if

0 commit comments

Comments
 (0)