summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_configparser.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-08-13 23:47:41 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-08-13 23:47:41 (GMT)
commitf7a92673ab38f43c1d274e1663f62da394f4f153 (patch)
treecf25f632ec399556bf31bb10be43385bbcc4bee1 /Lib/test/test_configparser.py
parent5e8d47f6ab98f607e2df7b4ad27964eec70429a4 (diff)
parentac37ba0742b1eb794eca7b6fd95a1ffecc9b6333 (diff)
downloadcpython-f7a92673ab38f43c1d274e1663f62da394f4f153.zip
cpython-f7a92673ab38f43c1d274e1663f62da394f4f153.tar.gz
cpython-f7a92673ab38f43c1d274e1663f62da394f4f153.tar.bz2
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 470d2cd..71a8f3f 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("""