Alessandro Piccione added the comment:
You are right.
As the `--pattern` documentation says, the default pattern is "test*.py" which
does not match "aaaTest.py".
I had looking for the wrong pattern.
Thanks,
Alex
--
resolution: -> not a bug
stage: -> resolved
status: open ->
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__':
Alessandro Piccione added the comment:
If you refer to the -p ("pattern" parameter) I think not.
I have my module named aaaTest.py.
I is is not mentioned that discover look for modules named "test_" for which
reason I have to use a pattern?
If you refer to -s ("start-directory" parameter) same
Zachary Ware added the comment:
Does this cover what you're looking for?
https://docs.python.org/3/library/unittest.html#cmdoption-unittest-discover-p
--
nosy: +zach.ware
___
Python tracker
New submission from Alessandro Piccione:
1. execute "python -m unittest"
2. Result: 0 test found
3. Change file name from "aaaTest.py" to "test_aaa.py"
4. execute "python -m unittest"
3. Result: Ran 1 tests in 000.0s
Module file MUST be named using the prefiux "test_".
The page