=============================== warnings summary ===============================
…/…/…/Library/Python/3.9/lib/python/site-packages/requests/packages/urllib3/_collections.py:2
…/…/…/Library/Python/3.9/lib/python/site-packages/requests/packages/urllib3/_collections.py:2
/Users/****/Library/Python/3.9/lib/python/site-packages/requests/packages/urllib3/_collections.py:2: DeprecationWarning: Using or importing the ABCs from ‘collections’ instead of from ‘collections.abc’ is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Mapping, MutableMapping
…/…/…/Library/Python/3.9/lib/python/site-packages/_pytest/config/init.py:1294
/Users****e/Library/Python/3.9/lib/python/site-packages/_pytest/config/init.py:1294: PytestConfigWarning: Unknown config option: — addopts
self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
Review_lesssons/case/test_DS_022.py::test01
/Users/****/Library/Python/3.9/lib/python/site-packages/requests/models.py:170: DeprecationWarning: Using or importing the ABCs from ‘collections’ instead of from ‘collections.abc’ is deprecated since Python 3.3, and in 3.10 it will stop working
if isinstance(hook, collections.Callable):
报错原因:这个异常报错是导入collections的原因,上面说python3.10版本不在支持collections,建议使用collections.abc。
第一种情况: 在代码文件中导入了 collections 这个模块的报错
第二种情况:在代码文件中导入了 collections 这个模块依旧报错
解决方法:
创建pytest.ini文件,再次运行,不再警告⚠️
[pytest]
addopts = -p no:warnings