[pypy-commit] pypy py3k: kill all the tests which use import * from within a function, which is no longer syntactically valid. Leave just one test in the INVALID case
antocuni
noreply at buildbot.pypy.org
Fri Jan 27 00:31:37 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r51832:7c5c365ec355
Date: 2012-01-26 16:44 +0100
http://bitbucket.org/pypy/pypy/changeset/7c5c365ec355/
Log: kill all the tests which use import * from within a function, which
is no longer syntactically valid. Leave just one test in the INVALID
case
diff --git a/pypy/interpreter/test/test_syntax.py b/pypy/interpreter/test/test_syntax.py
--- a/pypy/interpreter/test/test_syntax.py
+++ b/pypy/interpreter/test/test_syntax.py
@@ -19,81 +19,39 @@
exec "hi"
x
- def f():
- def g():
- global x
- from a import *
- x
-
def f(x):
def g():
global x
exec "hi"
x
- def f(x):
- def g():
- global x
- from a import *
- x
-
- def f():
- def g():
- from a import *
-
def f():
def g():
exec "hi"
def f():
- from a import *
-
- def f():
exec "hi"
def f():
- from a import *
- def g():
- global x
- x
-
- def f():
exec "hi"
def g():
global x
x
def f():
- from a import *
- def g(x):
- x
-
- def f():
exec "hi"
def g(x):
x
def f():
- from a import *
- lambda x: x
-
- def f():
exec "hi"
lambda x: x
def f():
- from a import *
- x
-
- def f():
exec "hi"
x
def f():
- from a import *
- (i for i in x)
-
- def f():
exec "hi"
(i for i in x)
@@ -102,27 +60,21 @@
exec "hi"
x
- def f():
- class g:
- from a import *
- x
-
""")
-## --- the following ones are valid in CPython, but not sensibly so:
+## --- the following one is valid in CPython, but not sensibly so:
## --- if x is rebound, then it is even rebound in the parent scope!
## def f(x):
## class g:
-## from a import *
-## x
-## def f(x):
-## class g:
## exec "x=41"
## x
INVALID = splitcases("""
def f():
+ from x import *
+
+ def f():
def g():
exec "hi"
x
@@ -134,17 +86,6 @@
x
def f():
- def g():
- from a import *
- x
- # NB. the above one is invalid in CPython, but there is no real reason
-
- def f(x):
- def g():
- from a import *
- x
-
- def f():
exec "hi"
def g():
x
@@ -154,40 +95,17 @@
lambda x: y
def f():
- from a import *
- x
- def g():
- x
-
- def f():
- from a import *
- lambda x: y
-
- def f():
exec "hi"
class g:
x
def f():
- from a import *
- x
- class g:
- x
-
- def f():
exec "hi"
x = 5
class g:
def h():
x
- def f():
- from a import *
- x = 4
- class g:
- def h():
- x
-
def f(x):
exec "hi"
x = 4
@@ -195,33 +113,15 @@
x
def f(x):
- from a import *
- class g:
- x
-
- def f(x):
exec "hi"
x = 5
class g:
def h():
x
- def f(x):
- from a import *
- x = 5
- class g:
- def h():
- x
-
def f():
(i for i in x) = 10
- def f(x):
- def g():
- from a import *
- def k():
- return x
-
""")
More information about the pypy-commit
mailing list