enough-analyst-54434
11/06/2018, 1:22 PMone solution would be to set up a conftest.py that declares all necessary fixtures. and this also can be made to work in pants, but will require that all tests that use these kinds of fixtures declare conftest.py as a dependencyThat makes the most sense to me. If you find it distasteful you could write a very small plugin that exposes a
conftests
target that comes with this dep automatically added and use that instead of python_tests
in your BUILD file(s).
This conversation was very confusing for me because it had little to do with pants and alot to do with pytest. Importing a fixture does not work - pants aside - if that fixture depends on another - even in the same file - unless you either a.) import it too (even though you don't use it) or b.) use conftest.py to register all your fixtures. I think the summary is that Pants can't help you today with the extras bogus imports technique in a.) and it forces you to make the implicit dependency on conftest.py to work its magic explicit for technique b.). I'm not sure how we'd make either better except to to ship a canned version of the conftests
plugin target described above. If you can think of a better idea it's probably worth an enhancement/idea issue to flesh it out.fierce-park-88503
11/06/2018, 4:33 PMenough-analyst-54434
11/06/2018, 4:35 PMfierce-park-88503
11/06/2018, 4:39 PMfierce-park-88503
11/06/2018, 4:40 PMenough-analyst-54434
11/06/2018, 4:40 PMcontests
target is the minimal disruption way to go.enough-analyst-54434
11/06/2018, 4:41 PM