summaryrefslogtreecommitdiff
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-21 11:03:21 +0000
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-21 11:03:21 +0000
commitaf61719ec354015566028250a2912efa30f4cda4 (patch)
tree12bf4f63f55f7954459c17705df21c5d0540e9f1 /Lib/test/test_compile.py
parent8f43cec41b13ee97a688327601f799bda1742f61 (diff)
downloadcpython-git-af61719ec354015566028250a2912efa30f4cda4.tar.gz
Silence some py3k SyntaxWarning using check_py3k_warnings() with "exec" statements.
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 1a2009c6eb..8a95f6da35 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -2,6 +2,7 @@ import unittest
import sys
import _ast
from test import test_support
+import textwrap
class TestSpecifics(unittest.TestCase):
@@ -142,6 +143,9 @@ def f(x):
def test_complex_args(self):
+ with test_support.check_py3k_warnings(
+ ("tuple parameter unpacking has been removed", SyntaxWarning)):
+ exec textwrap.dedent('''
def comp_args((a, b)):
return a,b
self.assertEqual(comp_args((1, 2)), (1, 2))
@@ -159,6 +163,7 @@ def f(x):
return a, b, c
self.assertEqual(comp_args(1, (2, 3)), (1, 2, 3))
self.assertEqual(comp_args(), (2, 3, 4))
+ ''')
def test_argument_order(self):
try: