I need your kind help to access a feature from any directory to my test class in pytest.
I can create the fixture inside the test class itself and call without any problem and it works fine too. I also know that creating the desired fixture in conftest.py will also help me.
However, my specific requirement is, I need to define a fixture in a separate directory and call in my test class(es).
Please refer to the screenshots, to understand my requirement exactly.
In data/testdata/InvalidLoginData.py
, I have defined the fixture.
I want to use the data in test_invalidlogin.py
Could you please advise -
- If I am doing any mistake?
- Is it possible in pytest?
Edit: I checked this and this, but they do not suit my requirement.