Hi Bruno, On 2 Jan 2015 14:11, "Bruno Oliveira" <[email protected]> wrote: > In my case, I would like to reuse fixtures defined in conftest files between different projects. > For instance, project2 depends on project1's fixtures which are defined in a conftest file, so I would like to simply add a "pytest_plugins = ['project1.conftest']" to project2's own conftest file. If I understand correctly, I would have to move project1's fixture to a different file, say "project1.plugin", and reference it in both project1 and project2's conftest files. Is this the recommended approach?
I would say so indeed. If you need to share fixtures between projects then I would create a 3rd project which provides a the plugin under a name. The contest.py files are meant for within a single project/directory structure and personally I frown upon any manual importing or otherwise loading them. They ought to be strictly related to their location so once you need to start importing them or loading them as a plugin explicitly it is a sign to me that the code is in the wrong place. Regards, Floris
_______________________________________________ pytest-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pytest-dev
