2

This is my directory structure:

test_directory/
├── test_feature_1/
│   ├── test1.py
│   └── test2.py
└── test_feature_2/
    ├── test3.py
    └── test4.py

I want to run a fixture function ONCE and then execute each of the tests in test_feature_1 directory. After that, teardown the fixture. I do not want to execute this fixture for other tests in other directories.

Which scope should I use and where should I define my conftest.py? Thanks!

Sourav
  • 43
  • 5
  • Does this answer your question? https://stackoverflow.com/questions/34466027/in-pytest-what-is-the-use-of-conftest-py-files – pavelsaman Jul 04 '20 at 11:25
  • Does this answer your question? [In pytest, what is the use of conftest.py files?](https://stackoverflow.com/questions/34466027/in-pytest-what-is-the-use-of-conftest-py-files) – MrBean Bremen Jul 04 '20 at 12:47

0 Answers0