小编Yed*_*rab的帖子

如何禁用 PytestDeprecationWarning:不推荐直接构建 Flake8Item,请使用 Flake8Item.from_parent

  • 当我python setup.py test在我的项目文件夹中运行命令以使用setup.cfg配置测试我的包时,我收到了此警告消息。
  • 我怎样才能禁用它?

? python setup.py test就像pytest --flake8命令一样。

============================================================================================== warnings summary =============================================================================================== 
c:\users\yedhrab\appdata\local\programs\python\python38\lib\site-packages\pytest_flake8.py:65
  c:\users\yedhrab\appdata\local\programs\python\python38\lib\site-packages\pytest_flake8.py:65: PytestDeprecationWarning: direct construction of Flake8Item has been deprecated, please use Flake8Item.from_parent
    return Flake8Item(

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================================================================================== short test summary info =========================================================================================== 
SKIPPED [1] c:\users\***\appdata\local\programs\python\python38\lib\site-packages\pytest_flake8.py:106: file(s) previously passed FLAKE8 checks
=================================================================================== 9 passed, 1 skipped, 1 warning in 0.33s =================================================================================== 
Run Code Online (Sandbox Code Playgroud)

python pytest flake8

1
推荐指数
1
解决办法
3248
查看次数

标签 统计

flake8 ×1

pytest ×1

python ×1