]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Silence warnings from openapi-core
authorStephen Finucane <stephen@that.guru>
Mon, 9 May 2022 10:27:11 +0000 (11:27 +0100)
committerStephen Finucane <stephen@that.guru>
Mon, 9 May 2022 10:27:11 +0000 (11:27 +0100)
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 <stephen@that.guru>
patchwork/tests/__init__.py

index 8f78ea79db34aefc88be3d2d99c4dd5062c384d3..886d8dca477177e76daa02974dd9f14994c6827a 100644 (file)
@@ -4,7 +4,24 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 import os
+import warnings
 
 TEST_MAIL_DIR = os.path.join(os.path.dirname(__file__), 'mail')
 TEST_PATCH_DIR = os.path.join(os.path.dirname(__file__), 'patches')
 TEST_FUZZ_DIR = os.path.join(os.path.dirname(__file__), 'fuzztests')
+
+# configure warnings
+
+warnings.simplefilter('once', DeprecationWarning)
+
+# TODO: Remove this once [1] merges and is released
+# [1] https://github.com/p1c2u/openapi-core/pull/395
+warnings.filterwarnings(
+    'ignore',
+    message=(
+        'The distutils package is deprecated and slated for removal in Python '
+        '3.12. Use setuptools or check PEP 632 for potential alternatives'
+    ),
+    module='openapi_core',
+    category=DeprecationWarning,
+)