diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 9db6aec1920..ec8fcc3eef0 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1363,13 +1363,17 @@ class TestShutil(unittest.TestCase): "disk_usage not available on this platform") def test_disk_usage(self): usage = shutil.disk_usage(os.path.dirname(__file__)) - self.assertEqual(usage, shutil.disk_usage(__file__)) + for attr in ('total', 'used', 'free'): + self.assertIsInstance(getattr(usage, attr), int) self.assertGreater(usage.total, 0) self.assertGreater(usage.used, 0) self.assertGreaterEqual(usage.free, 0) self.assertGreaterEqual(usage.total, usage.used) self.assertGreater(usage.total, usage.free) + # bpo-32557: Check that disk_usage() also accepts a filename + shutil.disk_usage(__file__) + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") @unittest.skipUnless(hasattr(os, 'chown'), 'requires os.chown') def test_chown(self):