From 27d64ded87548b01d8de350fb4035f3bd1b9e9cd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 12 Apr 2022 14:12:11 +0300 Subject: [PATCH] gh-90765: Catch deprecation warning --- Lib/test/test_configparser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index efd98ffb67a546..59c4b275cb46d7 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -1028,7 +1028,9 @@ class CustomConfigParser(configparser.ConfigParser): class ConfigParserTestCaseLegacyInterpolation(ConfigParserTestCase): config_class = configparser.ConfigParser - interpolation = configparser.LegacyInterpolation() + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + interpolation = configparser.LegacyInterpolation() def test_set_malformatted_interpolation(self): cf = self.fromstring("[sect]\n"