为什么 pytest 不使用 pyproject.toml 来表示这个弃用警告

问题描述

我有一个使用 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 配置有什么问题,没有被接收到?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)