Skip to content

Commit

Permalink
fix(tests): skip used memory tests with free version >= 4.0
Browse files Browse the repository at this point in the history
Signed-off-by: mayeut <[email protected]>
  • Loading branch information
mayeut committed Jun 18, 2024
1 parent 759971b commit 25c1c27
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,14 @@ def test_used(self):
# This got changed in:
# https://gitlab.com/procps-ng/procps/commit/
# 05d751c4f076a2f0118b914c5e51cfbb4762ad8e
# Newer versions of procps are using yet another way to compute used
# memory.
# https://gitlab.com/procps-ng/procps/commit/
# 2184e90d2e7cdb582f9a5b706b47015e56707e4d
if get_free_version_info() < (3, 3, 12):
raise unittest.SkipTest("old free version")
raise unittest.SkipTest("free version too old")
if get_free_version_info() >= (4, 0, 0):
raise unittest.SkipTest("free version too recent")
cli_value = free_physmem().used
psutil_value = psutil.virtual_memory().used
self.assertAlmostEqual(
Expand Down Expand Up @@ -342,8 +348,14 @@ def test_used(self):
# This got changed in:
# https://gitlab.com/procps-ng/procps/commit/
# 05d751c4f076a2f0118b914c5e51cfbb4762ad8e
# Newer versions of procps are using yet another way to compute used
# memory.
# https://gitlab.com/procps-ng/procps/commit/
# 2184e90d2e7cdb582f9a5b706b47015e56707e4d
if get_free_version_info() < (3, 3, 12):
raise unittest.SkipTest("old free version")
raise unittest.SkipTest("free version too old")
if get_free_version_info() >= (4, 0, 0):
raise unittest.SkipTest("free version too recent")
vmstat_value = vmstat('used memory') * 1024
psutil_value = psutil.virtual_memory().used
self.assertAlmostEqual(
Expand Down

0 comments on commit 25c1c27

Please sign in to comment.