Skip to content

Commit 5a8721f

Browse files
committed
Ignore third-party deprecation warnings @ py311
Refs: * benoitc/gunicorn#2840 * certifi/python-certifi#199 (cherry picked from commit bddb77d)
1 parent 2625a03 commit 5a8721f

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

setup.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ filterwarnings =
140140
# Temporarily ignore warnings internal to Python 3.9.7, can be removed again in 3.9.8.
141141
ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning:asyncio
142142
ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning::
143+
# The following deprecation warning is triggered by importing
144+
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
145+
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
146+
ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing
147+
# The deprecation warning below is happening under Python 3.11 and
148+
# is fixed by https://github.com/certifi/python-certifi/pull/199. It
149+
# can be dropped with the next release of `certify`, specifically
150+
# `certify > 2022.06.15`.
151+
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
143152
junit_suite_name = aiohttp_test_suite
144153
norecursedirs = dist docs build .tox .eggs
145154
minversion = 3.8.2

tests/test_circular_imports.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ def test_no_warnings(import_path: str) -> None:
7878
This is seeking for any import errors including ones caused
7979
by circular imports.
8080
"""
81-
imp_cmd = sys.executable, "-W", "error"
81+
imp_cmd = (
82+
# fmt: off
83+
sys.executable,
84+
"-W", "error",
85+
# The following deprecation warning is triggered by importing
86+
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
87+
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
88+
"-W", "ignore:module 'sre_constants' is "
89+
"deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing",
90+
"-c", f"import {import_path!s}",
91+
# fmt: on
92+
)
8293

8394
subprocess.check_call(imp_cmd)

0 commit comments

Comments
 (0)