diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-12-04 01:11:21 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-12-04 01:11:21 (GMT) |
commit | 37d120aeb471b3fba7e16550cea5d79ecb901561 (patch) | |
tree | b2b9b0c58d6510c8f3e3c53285cf6b498ad3ec72 /Doc/library/unittest.rst | |
parent | e2bb4eb77b24a1870bd7feb15124b7adf1460efe (diff) | |
download | cpython-37d120aeb471b3fba7e16550cea5d79ecb901561.zip cpython-37d120aeb471b3fba7e16550cea5d79ecb901561.tar.gz cpython-37d120aeb471b3fba7e16550cea5d79ecb901561.tar.bz2 |
Issue 10620: Specifying test modules by path instead of module name to 'python -m unittest'
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r-- | Doc/library/unittest.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 2b9c2be..63ad705 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -204,6 +204,16 @@ modules, classes or even individual test methods:: You can pass in a list with any combination of module names, and fully qualified class or method names. +Test modules can be specified by file path as well:: + + python -m unittest tests/test_something.py + +This allows you to use the shell filename completion to specify the test module. +The file specified must still be importable as a module. The path is converted +to a module name by removing the '.py' and converting path separators into '.'. +If you want to execute a test file that isn't importable as a module you should +execute the file directly instead. + You can run tests with more detail (higher verbosity) by passing in the -v flag:: python -m unittest -v test_module |