diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index a2f512b8bc1..e5e18051a51 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -206,7 +206,7 @@ handle NAT with non-secure FTP without opening fixed ports. shutil ------ -The :mod:`shutil` module has a new :func:`~shutil.disk_usage` providing total, +The :mod:`shutil` module has a new :func:`~shutil.disk_usage` function providing total, used and free disk space statistics. (Contributed by Giampaolo RodolĂ  in :issue:`12442`) diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 20e9412aec3..b17ff3e20ea 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -732,11 +732,11 @@ class TestShutil(unittest.TestCase): "disk_usage not available on this platform") def test_disk_usage(self): usage = shutil.disk_usage(os.getcwd()) - self.assertTrue(usage.total > 0) - self.assertTrue(usage.used > 0) - self.assertTrue(usage.free >= 0) - self.assertTrue(usage.total >= usage.used) - self.assertTrue(usage.total > usage.free) + 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) class TestMove(unittest.TestCase):