aiohttp-swagger
aiohttp-swagger copied to clipboard
Compatibility with new PyYAML (version 5.1)
Recently PyYAML was released new version 5.1 and tests for my application detects new warning yaml.YAMLLoadWarning
for aiohttp-swagger
:
Traceback (most recent call last):
File "/home/_/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/_/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/_/develop/_/_/server.py", line 56, in serve
web.run_app(app_factory(), port=port)
File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp/web.py", line 415, in run_app
reuse_port=reuse_port))
File "/home/_/.pyenv/versions/3.7.0/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
return future.result()
File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp/web.py", line 278, in _run_app
app = await app # type: ignore
File "/home/_/develop/_/_/server.py", line 45, in app_factory
contact='Coffee Team',
File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp_swagger/__init__.py", line 62, in setup_swagger
api_version=api_version, title=title, contact=contact
File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp_swagger/helpers/builders.py", line 71, in generate_doc_from_each_end_point
swagger = yaml.load(swagger_base)
File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/yaml/__init__.py", line 109, in load
load_warning('load')
File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/yaml/__init__.py", line 55, in load_warning
warnings.warn(message, YAMLLoadWarning, stacklevel=3)
yaml.YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
Now, I muted that warning in my tests but hope that aiohttp-swagger
fix compatibility.
For anyone wondering, you can suppress the warning like this:
python -W ignore::yaml.YAMLLoadWarning:aiohttp_swagger.helpers.builders:123
pytest -W ignore::yaml.YAMLLoadWarning:aiohttp_swagger.helpers.builders:123