[Python] How to forbid to loading conftest files in upper directories

Discussão em 'Python' iniciado por Stack, Junho 5, 2025.

  1. Stack

    Stack Membro Participativo

    I have structure like this:

    conftest.py
    dir/conftest.py
    dir/test_my.py


    When I change directory to dir and run py.test test_my.py, my tests start with configuration, declared in the outer conftest.py (which is out of dir). Is there any way to change pytest behaviour: to load conftest-file only from the local directory?

    Continue reading...

Compartilhe esta Página