summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index a28875e..c0b1bfc 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -9,6 +9,7 @@ from test import test_support
#
class RoundtripLegalSyntaxTestCase(unittest.TestCase):
+
def roundtrip(self, f, s):
st1 = f(s)
t = st1.totuple()
@@ -134,6 +135,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
#
class IllegalSyntaxTestCase(unittest.TestCase):
+
def check_bad_tree(self, tree, label):
try:
parser.sequence2st(tree)
@@ -147,7 +149,7 @@ class IllegalSyntaxTestCase(unittest.TestCase):
self.check_bad_tree((1, 2, 3), "<junk>")
def test_illegal_yield_1(self):
- """Illegal yield statement: def f(): return 1; yield 1"""
+ # Illegal yield statement: def f(): return 1; yield 1
tree = \
(257,
(264,
@@ -202,7 +204,7 @@ class IllegalSyntaxTestCase(unittest.TestCase):
self.check_bad_tree(tree, "def f():\n return 1\n yield 1")
def test_illegal_yield_2(self):
- """Illegal return in generator: def f(): return 1; yield 1"""
+ # Illegal return in generator: def f(): return 1; yield 1
tree = \
(257,
(264,
@@ -266,7 +268,7 @@ class IllegalSyntaxTestCase(unittest.TestCase):
self.check_bad_tree(tree, "def f():\n return 1\n yield 1")
def test_print_chevron_comma(self):
- """Illegal input: print >>fp,"""
+ # Illegal input: print >>fp,
tree = \
(257,
(264,
@@ -289,7 +291,7 @@ class IllegalSyntaxTestCase(unittest.TestCase):
self.check_bad_tree(tree, "print >>fp,")
def test_a_comma_comma_c(self):
- """Illegal input: a,,c"""
+ # Illegal input: a,,c
tree = \
(258,
(311,
@@ -316,7 +318,7 @@ class IllegalSyntaxTestCase(unittest.TestCase):
self.check_bad_tree(tree, "a,,c")
def test_illegal_operator(self):
- """Illegal input: a $= b"""
+ # Illegal input: a $= b
tree = \
(257,
(264,