]> granicus.if.org Git - python/commitdiff
[3.6] Make test_shutil test_disk_usage not depend on the cwd fs (GH-2597) (#2820)
authorGregory P. Smith <greg@krypto.org>
Sun, 23 Jul 2017 06:00:39 +0000 (23:00 -0700)
committerGitHub <noreply@github.com>
Sun, 23 Jul 2017 06:00:39 +0000 (23:00 -0700)
Make test_shutil test_disk_usage not depend on the current working directory's filesystem.
(cherry picked from commit 529746c90584069270cd122920270bd7be38bca3)

Lib/test/test_shutil.py

index 2ad3a21c86d2c1bd2813219c2ee3a1a907905b43..b2ab1af296d682b35ab010e36a42ef8e495290df 100644 (file)
@@ -1294,7 +1294,7 @@ class TestShutil(unittest.TestCase):
     @unittest.skipUnless(hasattr(shutil, 'disk_usage'),
                          "disk_usage not available on this platform")
     def test_disk_usage(self):
-        usage = shutil.disk_usage(os.getcwd())
+        usage = shutil.disk_usage(os.path.dirname(__file__))
         self.assertGreater(usage.total, 0)
         self.assertGreater(usage.used, 0)
         self.assertGreaterEqual(usage.free, 0)