diff options
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r-- | Lib/test/test_configparser.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index da17c00..eef4394 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -907,9 +907,6 @@ class ConfigParserTestCase(BasicTestCase, unittest.TestCase): if self.interpolation == configparser._UNSET: self.assertEqual(e.args, ("bar11", "Foo", "something %(with11)s lots of interpolation (11 steps)")) - elif isinstance(self.interpolation, configparser.LegacyInterpolation): - self.assertEqual(e.args, ("bar11", "Foo", - "something %(with11)s lots of interpolation (11 steps)")) def test_interpolation_missing_value(self): cf = self.get_interpolation_config() @@ -921,9 +918,6 @@ class ConfigParserTestCase(BasicTestCase, unittest.TestCase): if self.interpolation == configparser._UNSET: self.assertEqual(e.args, ('name', 'Interpolation Error', '%(reference)s', 'reference')) - elif isinstance(self.interpolation, configparser.LegacyInterpolation): - self.assertEqual(e.args, ('name', 'Interpolation Error', - '%(reference)s', 'reference')) def test_items(self): self.check_items_config([('default', '<default>'), @@ -942,9 +936,6 @@ class ConfigParserTestCase(BasicTestCase, unittest.TestCase): self.assertEqual(cf.get("section", "ok"), "xxx/%s") if self.interpolation == configparser._UNSET: self.assertEqual(cf.get("section", "not_ok"), "xxx/xxx/%s") - elif isinstance(self.interpolation, configparser.LegacyInterpolation): - with self.assertRaises(TypeError): - cf.get("section", "not_ok") def test_set_malformatted_interpolation(self): cf = self.fromstring("[sect]\n" @@ -1025,31 +1016,6 @@ class ConfigParserTestCaseNoInterpolation(BasicTestCase, unittest.TestCase): cf.read_string(self.ini) self.assertMatchesIni(cf) - -class ConfigParserTestCaseLegacyInterpolation(ConfigParserTestCase): - config_class = configparser.ConfigParser - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - interpolation = configparser.LegacyInterpolation() - - def test_set_malformatted_interpolation(self): - cf = self.fromstring("[sect]\n" - "option1{eq}foo\n".format(eq=self.delimiters[0])) - - self.assertEqual(cf.get('sect', "option1"), "foo") - - cf.set("sect", "option1", "%foo") - self.assertEqual(cf.get('sect', "option1"), "%foo") - cf.set("sect", "option1", "foo%") - self.assertEqual(cf.get('sect', "option1"), "foo%") - cf.set("sect", "option1", "f%oo") - self.assertEqual(cf.get('sect', "option1"), "f%oo") - - # bug #5741: double percents are *not* malformed - cf.set("sect", "option2", "foo%%bar") - self.assertEqual(cf.get("sect", "option2"), "foo%%bar") - - class ConfigParserTestCaseInvalidInterpolationType(unittest.TestCase): def test_error_on_wrong_type_for_interpolation(self): for value in [configparser.ExtendedInterpolation, 42, "a string"]: @@ -1636,14 +1602,6 @@ class CoverageOneHundredTestCase(unittest.TestCase): self.assertEqual(str(cm.exception), "bad interpolation variable " "reference '%(()'") - def test_legacyinterpolation_deprecation(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always", DeprecationWarning) - configparser.LegacyInterpolation() - self.assertGreaterEqual(len(w), 1) - for warning in w: - self.assertIs(warning.category, DeprecationWarning) - def test_sectionproxy_repr(self): parser = configparser.ConfigParser() parser.read_string(""" |