有没有办法抑制pytest的内部弃用警告?
语境:我期待评估从移植测试套件的难度nose来pytest.该套件相当大,并且基于使用nose风格yield的测试生成器.
我想首先确保现有测试通过pytest,然后可能将测试生成器更改为parameterized.
刚运行$ pytest path-to-test-folderpytest 3.0.4完全由页面和页面控制
WC1 ~repos/numpy/numpy/lib/tests/test_twodim_base.py yield tests are deprecated, and scheduled to be removed in pytest 4.0
Run Code Online (Sandbox Code Playgroud)
有没有办法解决这些警告?
我正在尝试在 python/django 项目中使用 boto3 。我以前已经这样做过,但是在运行 localhost 时它向我发出警告 - 这破坏了我尝试运行的请求。我使用的是 python 3.7 版本。我在 boto3 的 GitHub 存储库中看到了提出的问题,大多数是指运行 pytest 时出现的错误。我的问题似乎与最新的 PR 不符
https://github.com/boto/botocore/issues/1615
我不太确定该转向哪里。非常感谢任何建议。
from . import urllib3
File "/Users/neilballard/.local/share/virtualenvs/Volley-ldVCpc8_/lib/python3.7/site-packages/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
from .connectionpool import (
File "/Users/neilballard/.local/share/virtualenvs/Volley-ldVCpc8_/lib/python3.7/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 38, in <module>
from .response import HTTPResponse
File "/Users/neilballard/.local/share/virtualenvs/Volley-ldVCpc8_/lib/python3.7/site-packages/botocore/vendored/requests/packages/urllib3/response.py", line 9, in <module>
from ._collections import HTTPHeaderDict
File "/Users/neilballard/.local/share/virtualenvs/Volley-ldVCpc8_/lib/python3.7/site-packages/botocore/vendored/requests/packages/urllib3/_collections.py", line 1, in <module>
from collections import Mapping, MutableMapping
File "<frozen importlib._bootstrap>", line 1032, in _handle_fromlist
File "/Users/neilballard/.local/share/virtualenvs/Volley-ldVCpc8_/lib/python3.7/collections/__init__.py", line 52, in __getattr__ …Run Code Online (Sandbox Code Playgroud)