[pypy-commit] pypy popen-pclose: more asserts for rfile test

krono noreply at buildbot.pypy.org
Wed Mar 5 10:17:26 CET 2014


Author: Tobias Pape <tobias at netshed.de>
Branch: popen-pclose
Changeset: r69708:7cccc9080c5b
Date: 2014-03-04 11:33 +0100
http://bitbucket.org/pypy/pypy/changeset/7cccc9080c5b/

Log:	more asserts for rfile test

diff --git a/rpython/rlib/test/test_rfile.py b/rpython/rlib/test/test_rfile.py
--- a/rpython/rlib/test/test_rfile.py
+++ b/rpython/rlib/test/test_rfile.py
@@ -214,17 +214,24 @@
             py.test.skip("not for win32")
 
     def test_popen(self):
+        printval = 42
+        cmd = "python -c 'print %s'" % printval
         def f():
-            f = rfile.create_popen_file("python -c 'print 42'", "r")
+            f = rfile.create_popen_file(cmd, "r")
             s = f.read()
             f.close()
+            assert s == "%s\n" % printval
         self.interpret(f, [])
 
     def test_pclose(self):
+        printval = 42
         retval = 32
-        cmd = "python -c 'import sys; print 45; sys.exit(%s)'" % retval
+        cmd = "python -c 'import sys; print %s; sys.exit(%s)'" % (
+            printval, retval)
         def f():
             f = rfile.create_popen_file(cmd, "r")
             s = f.read()
+            assert s == "%s\n" % printval
             return f.close()
         r = self.interpret(f, [])
+        assert r == retval


More information about the pypy-commit mailing list