summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-11-19 23:01:36 +0000
committerBenjamin Peterson <benjamin@python.org>2009-11-19 23:01:36 +0000
commit440847cf8e1f60c81e1ac1f722b6e7ad4c295acd (patch)
tree7a8ebdaebc42ef9c985745fb250ca48f81ba59c4 /Lib/test/test_syntax.py
parentaa4af333eca371f053ed238ddfc12f67441f431d (diff)
downloadcpython-git-440847cf8e1f60c81e1ac1f722b6e7ad4c295acd.tar.gz
Merged revisions 76416-76417 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76416 | benjamin.peterson | 2009-11-19 16:54:57 -0600 (Thu, 19 Nov 2009) | 10 lines improve several corner cases related with argument names in parenthesis - Fix #7362: give a good error message for parenthesized arguments with defaults. - Add a py3k warning for any parenthesized arguments since those are not allowed in Py3. This warning is not given in tuple unpacking, since that incurs the tuple unpacking warning. ........ r76417 | benjamin.peterson | 2009-11-19 16:58:01 -0600 (Thu, 19 Nov 2009) | 1 line add news notes for r76416 ........
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index e978a6ec7a..366c1e80b2 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -447,10 +447,14 @@ class SyntaxTestCase(unittest.TestCase):
self.fail("SyntaxError is not a %s" % subclass.__name__)
mo = re.search(errtext, str(err))
if mo is None:
- self.fail("SyntaxError did not contain '%r'" % (errtext,))
+ self.fail("%s did not contain '%r'" % (err, errtext,))
else:
self.fail("compile() did not raise SyntaxError")
+ def test_paren_arg_with_default(self):
+ self._check_error("def f((x)=23): pass",
+ "parenthesized arg with default")
+
def test_assign_call(self):
self._check_error("f() = 1", "assign")