swift-river-7352005/15/2023, 8:50 PM
in the same way pytest does, even if a test target doesn't refer to any fixtures in
? I am transitioning a repo to use pants, and when I run a target that doesn't use any fixtures it still seems to want to include the conftest file and all its dependencies. Is the only way around this to put the test in a folder that doesn't have conftest.py in one of its parent folders?
for example the tests are structured like this:
tests/foo/bar/test_file.py #doesn't refer to any fixtures in tests/conftest.py
bitter-ability-3219005/15/2023, 9:06 PM
curved-television-656805/15/2023, 9:21 PM
Is the only way around this to put the test in a folder that doesn’t have conftest.py in one of its parent folders?If you want to preserve the directory structure, you may be able to exclude it with
See “ignore dependencies with ! and !!” in https://www.pantsbuild.org/docs/targets#dependencies-field
N.b. I’ve only used this with 3rdparty requirements, not the conftest.py file, so not sure if it will actually work as desired.
swift-river-7352005/15/2023, 9:22 PM