Skip to content

Commit

Permalink
Ignore third-party deprecation warnings @ py311
Browse files Browse the repository at this point in the history
Refs:
* benoitc/gunicorn#2840
* certifi/python-certifi#199

(cherry picked from commit bddb77d)
  • Loading branch information
webknjaz committed Aug 3, 2022
1 parent a52c649 commit 4720070
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
9 changes: 9 additions & 0 deletions setup.cfg
Expand Up @@ -141,6 +141,15 @@ filterwarnings =
ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning:asyncio
ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning::
ignore::ResourceWarning
# The following deprecation warning is triggered by importing
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing
# The deprecation warning below is happening under Python 3.11 and
# is fixed by https://github.com/certifi/python-certifi/pull/199. It
# can be dropped with the next release of `certify`, specifically
# `certify > 2022.06.15`.
ignore:path is deprecated. Use files.. instead. Refer to https.//importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.:DeprecationWarning:certifi.core
junit_suite_name = aiohttp_test_suite
norecursedirs = dist docs build .tox .eggs
minversion = 3.8.2
Expand Down
13 changes: 12 additions & 1 deletion tests/test_circular_imports.py
Expand Up @@ -71,6 +71,17 @@ def test_no_warnings(import_path: str) -> None:
This is seeking for any import errors including ones caused
by circular imports.
"""
imp_cmd = sys.executable, "-W", "error"
imp_cmd = (
# fmt: off
sys.executable,
"-W", "error",
# The following deprecation warning is triggered by importing
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
"-W", "ignore:module 'sre_constants' is "
"deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing",
"-c", f"import {import_path!s}",
# fmt: on
)

subprocess.check_call(imp_cmd)

0 comments on commit 4720070

Please sign in to comment.