From d5d599925508082b6da06125ee0d6e98f5c1d22b Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 23 Jan 2022 12:32:30 +0300 Subject: [PATCH 1/2] Add a note about direct test module invocation --- runtests.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/runtests.rst b/runtests.rst index e018faa25..499f5ca55 100644 --- a/runtests.rst +++ b/runtests.rst @@ -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, for example ``test_importlib``, + in other words: if some module does not have ``unittest.main()`` + 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:: From ffc83ed4aab7b9023ce187ff7c62fda358c4a41f Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 28 Jan 2022 09:36:36 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Mariatta Wijaya --- runtests.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtests.rst b/runtests.rst index 499f5ca55..83f3c95c0 100644 --- a/runtests.rst +++ b/runtests.rst @@ -59,9 +59,9 @@ 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, for example ``test_importlib``, - in other words: if some module does not have ``unittest.main()`` - most likely it does not support direct invocation +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::