Skip to content

Commit

Permalink
fix test on bsd
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Dec 28, 2024
1 parent 5388ca5 commit 78abfff
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions psutil/tests/test_process_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,14 @@ def memory_maps(self, ret, info):
for fname in nt._fields:
value = getattr(nt, fname)
if fname == 'path':
if not value.startswith(("[", "anon_inode:")):
assert os.path.isabs(nt.path), nt.path
# commented as on Linux we might get
# '/foo/bar (deleted)'
# assert os.path.exists(nt.path), nt.path
if value.startswith(("[", "anon_inode:")): # linux
continue
if BSD and value == "pvclock": # seen on FreeBSD
continue
assert os.path.isabs(nt.path), nt.path
# commented as on Linux we might get
# '/foo/bar (deleted)'
# assert os.path.exists(nt.path), nt.path
elif fname == 'addr':
assert value, repr(value)
elif fname == 'perms':
Expand Down

0 comments on commit 78abfff

Please sign in to comment.