Author: Armin Rigo <[email protected]>
Branch:
Changeset: r75648:aaf45cb3d1a5
Date: 2015-02-02 18:14 +0100
http://bitbucket.org/pypy/pypy/changeset/aaf45cb3d1a5/
Log: Improve the tests to actually check that the file is created by the
interpret() version. They could pass by simply having the same file
already created by the direct f() version first.
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
@@ -26,6 +26,7 @@
f()
assert open(fname, "r").read() == "dupa"
+ os.unlink(fname)
self.interpret(f, [])
assert open(fname, "r").read() == "dupa"
@@ -102,6 +103,7 @@
f2.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
@py.test.mark.skipif("sys.platform == 'win32'")
@@ -121,6 +123,7 @@
f2.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
def test_open_buffering_full(self):
@@ -138,6 +141,7 @@
f2.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
def test_fdopen_buffering_full(self):
@@ -157,6 +161,7 @@
f2.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
def test_read_write(self):
@@ -203,6 +208,7 @@
f2.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
def test_read_sequentially(self):
@@ -277,6 +283,7 @@
f.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
def test_tempfile(self):
@@ -309,6 +316,7 @@
f()
assert open(fname).read() == "xxx"
+ os.unlink(fname)
self.interpret(f, [])
assert open(fname).read() == "xxx"
@@ -325,6 +333,7 @@
res = f()
assert res > 2
+ os.unlink(fname)
res = self.interpret(f, [])
assert res > 2
@@ -341,6 +350,7 @@
res = f()
assert res == 3
+ os.unlink(fname)
res = self.interpret(f, [])
assert res == 3
@@ -357,6 +367,7 @@
f.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
def test_truncate(self):
@@ -381,6 +392,7 @@
f.close()
f()
+ os.unlink(fname)
self.interpret(f, [])
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit