Commits

David Schneider committed 06f936c

skip test_statvfs if statvfs is not available
(transplanted from e02836bd3823d5c3db5b2dea56fba55f8e15094f)

Comments (0)

Files changed (1)

pypy/module/posix/test/test_posix2.py

                     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