Home > other >  Filename_test is not executed by pytest
Filename_test is not executed by pytest

Time:02-01

I am learning pytest and tried creating a py file ending with _test also method name ending with _test. But when i run pytest command my test methods is not getting collected.

And when i mrename the method name starting with test_ then pytest is able to collect the test.

Can anyone please help me to understand what could be the issue here?

enter image description here

enter image description here

CodePudding user response:

pytest by default uses test_*. If you want *_test then you have write the rule in pytest.ini file

  •  Tags:  
  • Related