Reputation: 8477
Why does pytest not collect my test?
My folder structure:
src
|-- examplemodule.py
tests
|-- test_examplemodule.py
Content of test_examplemodule.py
:
from unittest import TestCase
class TestExamplemodule(TestCase):
def run_mock_example(self):
# do stuff
Running python3 -m pytest tests
gives me collected 0 tests
Upvotes: 1
Views: 1669
Reputation: 1600
The function name should start or end with test_
or _test
respectively. So in your case test_run_mock_example()
Upvotes: 4