[docs] [issue30743] unittest discover does not mention module file must be named with "test_" prefix

Zachary Ware report at bugs.python.org
Tue Jun 27 16:01:56 EDT 2017


Zachary Ware added the comment:

This all seems to be covered in https://docs.python.org/3/library/unittest.html#test-discovery

$ cat aaaTest.py 
import unittest


class TestAAA(unittest.TestCase):

    def test_something(self):
        self.assertTrue(True)


if __name__ == '__main__':
    unittest.main()
$ python3 -m unittest discover -v -p "*Test.py"
test_something (aaaTest.TestAAA) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.000s

OK



As the `--pattern` documentation says, the default pattern is "test*.py" which does not match "aaaTest.py".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30743>
_______________________________________


More information about the docs mailing list