我有一个myfun.py
文件和我的函数。
我有一个test_myfun.py
文件,其中包含pytest
测试。在
当运行pytest test_myfun.py
时,测试本身运行时没有错误,但是pytest会给出警告。在
如何解决这些警告有什么建议吗?在
=============================== warnings summary ===============================
/home/rene/anaconda3/lib/python3.7/site-packages/html5lib/_trie/_base.py:3
/home/rene/anaconda3/lib/python3.7/site-packages/html5lib/_trie/_base.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping
/home/rene/anaconda3/lib/python3.7/site-packages/scrapy/item.py:8
/home/rene/anaconda3/lib/python3.7/site-packages/scrapy/item.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import MutableMapping
-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 11 passed, 2 warnings in 7.47 seconds =====================
版本信息:
-Python 3.7.3
-pytest 4.6.2版
你有两个选择。在
1)升级您的软件包,也就是说,}的最新版本修复了这些警告。在
html5lib
和{2)在repo的根目录中创建一个}
pytest.ini
文件,并给它这些内容,这将使pytest
忽略{相关问题 更多 >
编程相关推荐