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
commit4a16e8bc67bdf5e4a67f87e91acadc1f703ead9b (patch)
treec490650e88ce7a6e13e03c9533beb8ea3626c112 /Lib/test/test_configparser.py
parenteb71262fbd3ac864ac04bf46279f36468d48972c (diff)
downloadcpython-4a16e8bc67bdf5e4a67f87e91acadc1f703ead9b.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("""