<p dir="ltr">Hi Bruno,<br></p>
<p dir="ltr">On 2 Jan 2015 14:11, "Bruno Oliveira" <<a href="mailto:nicoddemus@gmail.com">nicoddemus@gmail.com</a>> wrote:<br>
> In my case, I would like to reuse fixtures defined in conftest files between different projects. <br>
> 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? </p>
<p dir="ltr">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.</p>
<p dir="ltr">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.</p>
<p dir="ltr">Regards,<br>
Floris</p>