Skip to content

Commit bddb77d

Browse files
committed
Ignore third-party deprecation warnings @ py311
Refs: * benoitc/gunicorn#2840 * certifi/python-certifi#199
1 parent 4d9a5fe commit bddb77d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

setup.cfg

+9
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ filterwarnings =
139139
ignore:Exception ignored in. <_io.FileIO .closed.>:pytest.PytestUnraisableExceptionWarning:_pytest.unraisableexception
140140
ignore:The loop argument is deprecated:DeprecationWarning:asyncio
141141
ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning::
142+
# The following deprecation warning is triggered by importing
143+
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
144+
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
145+
ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing
146+
# The deprecation warning below is happening under Python 3.11 and
147+
# is fixed by https://github.com/certifi/python-certifi/pull/199. It
148+
# can be dropped with the next release of `certify`, specifically
149+
# `certify > 2022.06.15`.
150+
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
142151
junit_suite_name = aiohttp_test_suite
143152
norecursedirs = dist docs build .tox .eggs
144153
minversion = 3.8.2

tests/test_circular_imports.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ def test_no_warnings(import_path: str) -> None:
7171
This is seeking for any import errors including ones caused
7272
by circular imports.
7373
"""
74-
imp_cmd = sys.executable, "-W", "error", "-c", f"import {import_path!s}"
74+
imp_cmd = (
75+
# fmt: off
76+
sys.executable,
77+
"-W", "error",
78+
# The following deprecation warning is triggered by importing
79+
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
80+
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
81+
"-W", "ignore:module 'sre_constants' is "
82+
"deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing",
83+
"-c", f"import {import_path!s}",
84+
# fmt: on
85+
)
7586

7687
subprocess.check_call(imp_cmd)

0 commit comments

Comments
 (0)