[Python-checkins] gh-90765: configparser test: Catch deprecation warning (#91480)

JelleZijlstra webhook-mailer at python.org
Mon May 2 13:22:44 EDT 2022


https://github.com/python/cpython/commit/56f98440148e4257aa5b27150ce2269c98cea0ea
commit: 56f98440148e4257aa5b27150ce2269c98cea0ea
branch: main
author: Hugo van Kemenade <hugovk at users.noreply.github.com>
committer: JelleZijlstra <jelle.zijlstra at gmail.com>
date: 2022-05-02T11:22:26-06:00
summary:

gh-90765: configparser test: Catch deprecation warning (#91480)

files:
M Lib/test/test_configparser.py

diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index efd98ffb67a54..59c4b275cb46d 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"



More information about the Python-checkins mailing list