Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.3
Changeset: r82565:2d2859fe2901
Date: 2016-02-26 14:44 +0100
http://bitbucket.org/pypy/pypy/changeset/2d2859fe2901/

Log:    Fix test so that the truncate() call actually fails

diff --git a/pypy/module/posix/test/test_posix2.py 
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -996,7 +996,8 @@
             # Check invalid inputs
             mkfile(dest)
             raises(OSError, posix.truncate, dest, -1)
-            raises(OSError, posix.truncate, 1, 1)
+            with open(dest, 'rb') as f:  # f is read-only so cannot be 
truncated
+                raises(OSError, posix.truncate, f.fileno(), 1)
             raises(TypeError, posix.truncate, dest, None)
             raises(TypeError, posix.truncate, None, None)
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to