Skip to content

Commit 4ddcdea

Browse files
committed
Silence warnings from openapi-core
This uses distutils. Hopefully my PR will be merged eventually. Until then, silencing the warning is good enough (Python 3.12 is aaaages away) Signed-off-by: Stephen Finucane <[email protected]>
1 parent 46a3afc commit 4ddcdea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

patchwork/tests/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@
44
# SPDX-License-Identifier: GPL-2.0-or-later
55

66
import os
7+
import warnings
78

89
TEST_MAIL_DIR = os.path.join(os.path.dirname(__file__), 'mail')
910
TEST_PATCH_DIR = os.path.join(os.path.dirname(__file__), 'patches')
1011
TEST_FUZZ_DIR = os.path.join(os.path.dirname(__file__), 'fuzztests')
12+
13+
# configure warnings
14+
15+
warnings.simplefilter('once', DeprecationWarning)
16+
17+
# TODO: Remove this once [1] merges and is released
18+
# [1] https://github.com/p1c2u/openapi-core/pull/395
19+
warnings.filterwarnings(
20+
'ignore',
21+
message=(
22+
'The distutils package is deprecated and slated for removal in Python '
23+
'3.12. Use setuptools or check PEP 632 for potential alternatives'
24+
),
25+
module='openapi_core',
26+
category=DeprecationWarning,
27+
)

0 commit comments

Comments
 (0)