I have a django project managed with pytest and poetry.
I'd like to put my pytest config into the pyproject.toml file, so I added:
[tool.pytest]
filterwarnings = ["ignore::django.utils.deprecation.RemovedInDjango40Warning", "ignore::django.utils.deprecation.RemovedInDjango41Warning"]
However, this made no difference - the warning weren't filtered.
If I add a pytest.ini file containing the following...
[pytest]
filterwarnings =
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
... it works just fine.
What's wrong with my pyproject.toml, or my pytest configuration, that it's not being picked up?
As per pytest's docs the section name should be [tool.pytest.ini_options]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With