]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-90765: configparser test: Catch deprecation warning (#91480)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Mon, 2 May 2022 17:22:26 +0000 (20:22 +0300)
committerGitHub <noreply@github.com>
Mon, 2 May 2022 17:22:26 +0000 (11:22 -0600)
Lib/test/test_configparser.py

index efd98ffb67a546f8443b34602e79d6597b2129c3..59c4b275cb46d7c3b1cd3b31283e43303ecbe53b 100644 (file)
@@ -1028,7 +1028,9 @@ class ConfigParserTestCaseNoInterpolation(BasicTestCase, unittest.TestCase):
 
 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"