Author: David Schneider <david.schnei...@picle.org>
Branch: 
Changeset: r65646:e02836bd3823
Date: 2013-07-25 15:55 +0200
http://bitbucket.org/pypy/pypy/changeset/e02836bd3823/

Log:    skip test_statvfs if statvfs is not available

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
@@ -184,14 +184,15 @@
                     assert isinstance(e, WindowsError)
                     assert e.winerror == 3
 
-    def test_statvfs(self):
-        st = self.posix.statvfs(".")
-        assert isinstance(st, self.posix.statvfs_result)
-        for field in [
-            'f_bsize', 'f_frsize', 'f_blocks', 'f_bfree', 'f_bavail',
-            'f_files', 'f_ffree', 'f_favail', 'f_flag', 'f_namemax',
-        ]:
-            assert hasattr(st, field)
+    if hasattr(__import__(os.name), "statvfs"):
+        def test_statvfs(self):
+            st = self.posix.statvfs(".")
+            assert isinstance(st, self.posix.statvfs_result)
+            for field in [
+                'f_bsize', 'f_frsize', 'f_blocks', 'f_bfree', 'f_bavail',
+                'f_files', 'f_ffree', 'f_favail', 'f_flag', 'f_namemax',
+            ]:
+                assert hasattr(st, field)
 
     def test_pickle(self):
         import pickle, os
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to