【发布时间】:2021-07-03 12:43:42
【问题描述】:
我有一个使用 pytest 和诗歌管理的 django 项目。
我想将我的 pytest 配置放入 pyproject.toml 文件中,所以我添加了:
[tool.pytest]
filterwarnings = ["ignore::django.utils.deprecation.RemovedInDjango40Warning", "ignore::django.utils.deprecation.RemovedInDjango41Warning"]
但是,这没有任何区别 - 警告没有被过滤。
如果我添加一个包含以下内容的 pytest.ini 文件...
[pytest]
filterwarnings =
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
...它工作得很好。
我的pyproject.toml 或我的 pytest 配置有什么问题,没有被拾取?
【问题讨论】:
标签: python pytest pytest-django pyproject.toml