Skip to content

Commit 9b57784

Browse files
sobolevnMariatta
andauthored
Add a note about direct test module invocation (#801)
Co-authored-by: Mariatta Wijaya <[email protected]>
1 parent 9cef971 commit 9b57784

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

runtests.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ path to the test case::
5050

5151
./python -m unittest -v test.test_abc.TestABC_Py
5252

53+
Some test modules also support direct invocation,
54+
which might be useful for IDEs and local debugging::
55+
56+
./python Lib/test/test_typing.py
57+
58+
But, there are several important notes:
59+
60+
1. This way of running tests exists only
61+
for local developer needs and is discouraged for anything else
62+
2. Some modules do not support it at all. One example is``test_importlib``.
63+
In other words: if some module does not have ``unittest.main()``, then
64+
most likely it does not support direct invocation.
65+
5366
If you have a multi-core or multi-CPU machine, you can enable parallel testing
5467
using several Python processes so as to speed up things::
5568

0 commit comments

Comments
 (0)