summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compiler.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-03-02 04:24:01 (GMT)
committerGuido van Rossum <guido@python.org>2006-03-02 04:24:01 (GMT)
commit5bde08dba3a34de7f625420035f1d0876bc71f39 (patch)
treebe63f21fd657d9011517d99810b39da0a7484897 /Lib/test/test_compiler.py
parent3a5468efb08335bff7b2135753cb9a5a9ddce0ac (diff)
downloadcpython-5bde08dba3a34de7f625420035f1d0876bc71f39.zip
cpython-5bde08dba3a34de7f625420035f1d0876bc71f39.tar.gz
cpython-5bde08dba3a34de7f625420035f1d0876bc71f39.tar.bz2
Fix failure of test_compiler.py when compiling test_contextlib.py.
The culprit was an expression-less yield -- the first apparently in the standard library. I added a unit test for this. Also removed the hack to force compilation of test_with.py.
Diffstat (limited to 'Lib/test/test_compiler.py')
-rw-r--r--Lib/test/test_compiler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index 6ec71ed..5e7b15c 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -20,7 +20,7 @@ class CompilerTest(unittest.TestCase):
for basename in os.listdir(dir):
if not basename.endswith(".py"):
continue
- if not TEST_ALL and random() < 0.98 and basename != "test_with.py":
+ if not TEST_ALL and random() < 0.98:
continue
path = os.path.join(dir, basename)
if test.test_support.verbose:
@@ -43,6 +43,9 @@ class CompilerTest(unittest.TestCase):
def testNewClassSyntax(self):
compiler.compile("class foo():pass\n\n","<string>","exec")
+ def testYieldExpr(self):
+ compiler.compile("def g(): yield\n\n", "<string>", "exec")
+
def testLineNo(self):
# Test that all nodes except Module have a correct lineno attribute.
filename = __file__