summaryrefslogtreecommitdiff
path: root/Lib/test/test_py3kwarn.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_py3kwarn.py')
-rw-r--r--Lib/test/test_py3kwarn.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 6d8863ad7b..55b327eaa9 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -31,6 +31,18 @@ class TestPy3KWarnings(unittest.TestCase):
exec "`2`" in {}
self.assertWarning(None, w, expected)
+ def test_paren_arg_names(self):
+ expected = 'parenthesized argument names are invalid in 3.x'
+ def check(s):
+ exec s in {}
+ self.assertWarning(None, w, expected)
+ with check_warnings() as w:
+ check("def f((x)): pass")
+ check("def f((((x))), (y)): pass")
+ check("def f((x), (((y))), m=32): pass")
+ # Something like def f((a, (b))): pass will raise the tuple
+ # unpacking warning.
+
def test_bool_assign(self):
# So we don't screw up our globals
def safe_exec(expr):