dimanche 20 décembre 2015

pytest - sepearate fixture logic from the tests

I have several packages I want to to write pytest tests for. All the packages should use same fixture logic, so I want to have the common test logic (fixtures) to sit in some common path and each package test should reside in its own path.

Repository 1:
=============
/path/to/PackageA/test_A.py
/path/to/PackageB/test_B.py

Repository 2:
=============
/different_path/to/Common/conftest.py

The problem is that when I run pytest on test_A.py or test_B.py, pytest doesn't find fixtures defined in conftest.py. Tried to play with --confcutdir option, but with no luck...

Aucun commentaire:

Enregistrer un commentaire