Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POSIX] Pass path to df(1) reference rather than device #2344

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions psutil/tests/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ def test_os_waitpid_bad_ret_status(self):
@unittest.skipIf(AIX, "unreliable on AIX")
@retry_on_failure()
def test_disk_usage(self):
def df(device):
def df(path):
try:
out = sh("df -k %s" % device).strip()
out = sh("df -k %s" % path).strip()
except RuntimeError as err:
if "device busy" in str(err).lower():
raise self.skipTest("df returned EBUSY")
Expand All @@ -440,7 +440,7 @@ def df(device):
for part in psutil.disk_partitions(all=False):
usage = psutil.disk_usage(part.mountpoint)
try:
total, used, free, percent = df(part.device)
total, used, free, percent = df(part.mountpoint)
except RuntimeError as err:
# see:
# https://travis-ci.org/giampaolo/psutil/jobs/138338464
Expand Down
Loading