mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Standardize behavior: no docstrings in test functions.
This commit is contained in:
parent
2e8bba5c21
commit
32c2ae7f4a
2 changed files with 13 additions and 10 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue