Skip to content

Add a note about direct test module invocation #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions runtests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ path to the test case::

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

Some test modules also support direct invocation,
which might be useful for IDEs and local debugging::

./python Lib/test/test_typing.py

But, there are several important notes:

1. This way of running tests exists only
for local developer needs and is discouraged for anything else
2. Some modules do not support it at all. One example is``test_importlib``.
In other words: if some module does not have ``unittest.main()``, then
most likely it does not support direct invocation.

If you have a multi-core or multi-CPU machine, you can enable parallel testing
using several Python processes so as to speed up things::

Expand Down