[pypy-commit] pypy py3k: fix the syntax here. The test still fails, no clue why

antocuni noreply at buildbot.pypy.org
Tue Feb 21 16:07:28 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52727:5a4f37c69744
Date: 2012-02-21 12:11 +0100
http://bitbucket.org/pypy/pypy/changeset/5a4f37c69744/

Log:	fix the syntax here. The test still fails, no clue why

diff --git a/pypy/interpreter/test/test_zpy.py b/pypy/interpreter/test/test_zpy.py
--- a/pypy/interpreter/test/test_zpy.py
+++ b/pypy/interpreter/test/test_zpy.py
@@ -11,6 +11,12 @@
     argslist = map(str, args)
     popen = subprocess.Popen(argslist, stdout=subprocess.PIPE)
     stdout, stderr = popen.communicate()
+    print '--- stdout ---'
+    print stdout
+    print
+    print '--- stderr ---'
+    print stderr
+    print
     return stdout
 
 
@@ -18,19 +24,19 @@
     """Ensures sys.executable points to the py.py script"""
     # TODO : watch out for spaces/special chars in pypypath
     output = run(sys.executable, pypypath,
-                 "-c", "import sys;print sys.executable")
+                 "-c", "import sys;print(sys.executable)")
     assert output.splitlines()[-1] == pypypath
 
 def test_special_names():
     """Test the __name__ and __file__ special global names"""
-    cmd = "print __name__; print '__file__' in globals()"
+    cmd = "print(__name__); print('__file__' in globals())"
     output = run(sys.executable, pypypath, '-c', cmd)
     assert output.splitlines()[-2] == '__main__'
     assert output.splitlines()[-1] == 'False'
 
     tmpfilepath = str(udir.join("test_py_script_1.py"))
     tmpfile = file( tmpfilepath, "w" )
-    tmpfile.write("print __name__; print __file__\n")
+    tmpfile.write("print(__name__); print(__file__)\n")
     tmpfile.close()
 
     output = run(sys.executable, pypypath, tmpfilepath)
@@ -41,22 +47,22 @@
     """Some tests on argv"""
     # test 1 : no arguments
     output = run(sys.executable, pypypath,
-                 "-c", "import sys;print sys.argv")
+                 "-c", "import sys;print(sys.argv)")
     assert output.splitlines()[-1] == str(['-c'])
 
     # test 2 : some arguments after
     output = run(sys.executable, pypypath,
-                 "-c", "import sys;print sys.argv", "hello")
+                 "-c", "import sys;print(sys.argv)", "hello")
     assert output.splitlines()[-1] == str(['-c','hello'])
     
     # test 3 : additionnal pypy parameters
     output = run(sys.executable, pypypath,
-                 "-O", "-c", "import sys;print sys.argv", "hello")
+                 "-O", "-c", "import sys;print(sys.argv)", "hello")
     assert output.splitlines()[-1] == str(['-c','hello'])
 
 SCRIPT_1 = """
 import sys
-print sys.argv
+print(sys.argv)
 """
 def test_scripts():
     tmpfilepath = str(udir.join("test_py_script.py"))


More information about the pypy-commit mailing list