Is there a way to specify pytest plugins below the...
# general
e
Is there a way to specify pytest plugins below the root level? I'm working in a codebase with a lot of django code, but also plenty non django code. If I put
Copy code
[pytest]
pytest_plugins.add = [
     "pytest-django",
in my
pants.toml
all the non django tests complain about not finding django settings
h
Probably best to add as an explicit dependency in that case to the tests that need it:
Copy code
python_tests(dependencies=["3rdparty/python:pytest-django"])
If that's getting too tedious, you could add a lightweight macro `django_tests`: https://www.pantsbuild.org/docs/macros. With the downside of a new symbol / some indirection
e
I think my complaint might have been preemptive. It was picking up plugins from a
pyproject.toml
file. Thanks~