summaryrefslogtreecommitdiff
path: root/Lib/test/test_configparser.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-08-14 11:11:35 +1200
committerRobert Collins <rbtcollins@hp.com>2015-08-14 11:11:35 +1200
commitac37ba0742b1eb794eca7b6fd95a1ffecc9b6333 (patch)
tree12115ccf8e8807ae4a111a4d1057c3350c57ff7b /Lib/test/test_configparser.py
parent4ce4f974da6dd67c0701454453420988624241d8 (diff)
downloadcpython-git-ac37ba0742b1eb794eca7b6fd95a1ffecc9b6333.tar.gz
Issue #21159: Improve message in configparser.InterpolationMissingOptionError.
Patch from Ɓukasz Langa.
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r--Lib/test/test_configparser.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index 09c229a612..3b035004cd 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -847,7 +847,8 @@ class ConfigParserTestCase(BasicTestCase, unittest.TestCase):
"something with lots of interpolation (10 steps)")
e = self.get_error(cf, configparser.InterpolationDepthError, "Foo", "bar11")
if self.interpolation == configparser._UNSET:
- self.assertEqual(e.args, ("bar11", "Foo", "%(with1)s"))
+ 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)"))
@@ -861,7 +862,7 @@ class ConfigParserTestCase(BasicTestCase, unittest.TestCase):
self.assertEqual(e.option, "name")
if self.interpolation == configparser._UNSET:
self.assertEqual(e.args, ('name', 'Interpolation Error',
- '', 'reference'))
+ '%(reference)s', 'reference'))
elif isinstance(self.interpolation, configparser.LegacyInterpolation):
self.assertEqual(e.args, ('name', 'Interpolation Error',
'%(reference)s', 'reference'))
@@ -1177,7 +1178,7 @@ class ConfigParserTestCaseExtendedInterpolation(BasicTestCase, unittest.TestCase
with self.assertRaises(exception_class) as cm:
cf['interpolated']['$trying']
self.assertEqual(cm.exception.reference, 'dollars:${sick')
- self.assertEqual(cm.exception.args[2], '}') #rawval
+ self.assertEqual(cm.exception.args[2], '${dollars:${sick}}') #rawval
def test_case_sensitivity_basic(self):
ini = textwrap.dedent("""