From: Stephen Finucane Date: Mon, 9 May 2022 10:27:11 +0000 (+0100) Subject: Silence warnings from openapi-core X-Git-Tag: v3.1.0~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ddcdea4;p=thirdparty%2Fpatchwork.git 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 --- diff --git a/patchwork/tests/__init__.py b/patchwork/tests/__init__.py index 8f78ea79..886d8dca 100644 --- a/patchwork/tests/__init__.py +++ b/patchwork/tests/__init__.py @@ -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, +)