Clarifying Python TDD Practices with pytest , Am I on the Right Track?

Hey @anusha_gg

I noticed your test methods like NifExplorer_SearchPath_Is_Not_None aren’t prefixed with test_, so pytest won’t recognize them as standalone tests.

That’s why you need to parametrize funcs and manually call them inside test_NifExplorer_ methods.

If you’re following TDD, every behavior should be expressed as a test first, and the best way to make that work with pytest is to define each of them as a regular test_… function.

Here’s how you could restructure that:

def test_block_type_is_not_none(setup_nifExplorer):
    for obj in setup_nifExplorer:
        assert obj.BlockType is not None

This simplifies your parameterized logic, helps maintain atomic tests, and aligns better with TDD because you’re writing behavior-based assertions, one at a time.