From 4ddcdea4a1ce84bbc279468d72c8da1cc0a5bd65 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 9 May 2022 11:27:11 +0100 Subject: [PATCH] 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 --- patchwork/tests/__init__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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, +) -- 2.47.3