From 78abfff96b2ad028d75b7b60da5db5c60965748d Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sat, 28 Dec 2024 10:55:58 +0100 Subject: [PATCH] fix test on bsd --- psutil/tests/test_process_all.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/psutil/tests/test_process_all.py b/psutil/tests/test_process_all.py index 6f321407c..cb7264d73 100755 --- a/psutil/tests/test_process_all.py +++ b/psutil/tests/test_process_all.py @@ -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':