diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-07 21:55:44 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-07 21:55:44 -0400 |
commit | c520887e5dd149abc8567037bef2d3670c3749a2 (patch) | |
tree | 06911a855ef34c4c66ed1dcc7b6ff18b5598501f | |
parent | 91b7e5f58477d4141fbf47552adbf929334dfe01 (diff) | |
download | mako-rel_0_7_1.tar.gz |
- these don't need to be switched for py3krel_0_7_1
-rw-r--r-- | test/test_ast.py | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/test/test_ast.py b/test/test_ast.py index 6051da6..f441881 100644 --- a/test/test_ast.py +++ b/test/test_ast.py @@ -75,40 +75,23 @@ for y in range(1, y): ) def test_locate_identifiers_4(self): - if util.py3k: - code = """ + code = """ x = 5 (y, ) def mydef(mydefarg): print("mda is", mydefarg) """ - else: - code = """ -x = 5 -(y, ) -def mydef(mydefarg): - print "mda is", mydefarg -""" parsed = ast.PythonCode(code, **exception_kwargs) eq_(parsed.undeclared_identifiers, set(['y'])) eq_(parsed.declared_identifiers, set(['mydef', 'x'])) def test_locate_identifiers_5(self): - if util.py3k: - code = """ + code = """ try: print(x) except: print(y) """ - else: - - code = """ -try: - print x -except: - print y -""" parsed = ast.PythonCode(code, **exception_kwargs) eq_(parsed.undeclared_identifiers, set(['x', 'y'])) @@ -120,38 +103,22 @@ def foo(): parsed = ast.PythonCode(code, **exception_kwargs) eq_(parsed.undeclared_identifiers, set(['bar'])) - if util.py3k: - code = """ + code = """ def lala(x, y): return x, y, z print(x) """ - else: - code = """ -def lala(x, y): - return x, y, z -print x -""" parsed = ast.PythonCode(code, **exception_kwargs) eq_(parsed.undeclared_identifiers, set(['z', 'x'])) eq_(parsed.declared_identifiers, set(['lala'])) - if util.py3k: - code = """ + code = """ def lala(x, y): def hoho(): def bar(): z = 7 print(z) """ - else: - code = """ -def lala(x, y): - def hoho(): - def bar(): - z = 7 -print z -""" parsed = ast.PythonCode(code, **exception_kwargs) eq_(parsed.undeclared_identifiers, set(['z'])) eq_(parsed.declared_identifiers, set(['lala'])) |