Pytest - no tests ran Pytest - no tests ran python python

Pytest - no tests ran


According to the pytest test conventions, your class should start with Test to be automatically picked up by the test discovery mechanism. Call it TestRegisterNewInstructor instead.

Or, subclass the unittest.TestCase:

import unittestclass RegisterNewInstructor(unittest.TestCase):    # ...

Also keep in mind that the .py test script itself must begin with test_ or end with _test in its filename.


As simple as it looks:

  1. Make sure that your file name matches the pattern: test_*.py or *_test.py.
  2. Make sure that your function name starts with the test prefix.

Find more about the pytest conventions here.


try add @classmethod on the top of setUP and tearDown.