pytest automatically discovers test files that start with test_ or end with _test.py. Option D lists files that follow these conventions.
pytest recognizes functions that start with test as test functions. Option C has all functions starting with test.
test_math.py with these functions, which function will NOT run during pytest execution?def test_add(): assert 1 + 1 == 2 def check_subtract(): assert 2 - 1 == 1 def test_multiply(): assert 2 * 3 == 6
pytest runs only functions whose names start with test. The function check_subtract does not start with test, so it will not run.
mathTests.py with functions named test_add and test_subtract. When running pytest, no tests are found. What is the most likely reason?pytest discovers test files only if their names start with test_ or end with _test.py. The file mathTests.py does not follow this convention, so pytest ignores it.
Best practice is to name test files starting with test_ or ending with _test.py and test functions starting with test_. Using descriptive names helps clarity and maintenance.
