diff options
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r-- | Lib/test/test_configparser.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index e9b03e6..569959c 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -1048,6 +1048,14 @@ class ConfigParserTestCaseLegacyInterpolation(ConfigParserTestCase): 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"]: + with self.subTest(value=value): + with self.assertRaises(TypeError): + configparser.ConfigParser(interpolation=value) + + class ConfigParserTestCaseNonStandardDelimiters(ConfigParserTestCase): delimiters = (':=', '$') comment_prefixes = ('//', '"') |