Skip to content

Commit

Permalink
try to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jan 1, 2024
1 parent 9436011 commit 3cabd5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,6 @@ def _disk_partitions_mountinfo():
device,
) = fields[:10]
opts2 = fields[10] if len(fields) >= 11 else ""

opts1 = opts1.split(",")
opts2 = opts2.split(",") if opts2 else []
opts = dict.fromkeys(opts1 + opts2)
Expand Down
9 changes: 5 additions & 4 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,18 +1157,19 @@ def parse_mount(out):
fstype = fields[4]
opts = fields[5][1:-1]
ls.append((device, mountpoint, fstype, opts))
return ls
return sorted(ls)

out = sh("mount")
mount = parse_mount(out)
with self.subTest(mount="\n" + out):
self.assertEqual(
mount, psutil._psplatform._disk_partitions_mountinfo())
mount, sorted(psutil._psplatform._disk_partitions_mountinfo()))
self.assertEqual(
mount, psutil._psplatform._disk_partitions_getmntent())
mount, sorted(psutil._psplatform._disk_partitions_getmntent()))
self.assertEqual(
mount,
[tuple(x[:4]) for x in psutil.disk_partitions(all=True)]
sorted([tuple(x[:4])
for x in psutil.disk_partitions(all=True)])
)

def test_zfs_fs(self):
Expand Down

0 comments on commit 3cabd5e

Please sign in to comment.