Author: Brian Kearns <[email protected]>
Branch: use-file-star-for-file
Changeset: r73511:9227e33346d4
Date: 2014-09-12 11:35 -0700
http://bitbucket.org/pypy/pypy/changeset/9227e33346d4/

Log:    skip /dev/full tests better

diff --git a/pypy/module/_file/test/test_file.py 
b/pypy/module/_file/test/test_file.py
--- a/pypy/module/_file/test/test_file.py
+++ b/pypy/module/_file/test/test_file.py
@@ -267,11 +267,9 @@
         with self.file(self.temppath, 'r') as f:
             raises(IOError, f.truncate, 100)
 
+    @py.test.mark.skipif("not os.path.exists('/dev/full')")
     def test_write_full_regular(self):
-        try:
-            f = self.file('/dev/full', 'w', 1)
-        except IOError:
-            skip("requires '/dev/full'")
+        f = self.file('/dev/full', 'w', 1)
         try:
             f.write('hello')
             raises(IOError, f.write, '\n')
@@ -281,13 +279,11 @@
         finally:
             f.close()
 
+    @py.test.mark.skipif("not os.path.exists('/dev/full')")
     def test_write_full_fdopen(self):
         import os
         fd = os.open('/dev/full', os.O_WRONLY)
-        try:
-            f = os.fdopen(fd, 'w', 1)
-        except IOError:
-            skip("requires '/dev/full'")
+        f = os.fdopen(fd, 'w', 1)
         try:
             f.write('hello')
             raises(IOError, f.write, '\n')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to