Skip to content

Commit

Permalink
Remove unneeded conditional
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Oct 21, 2022
1 parent 8bd2664 commit 00724f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ XXXX-XX-XX
``SPEED_UNKNOWN`` definition. (patch by Amir Rossert)
- 2010_, [macOS]: on MacOS, arm64 ``IFM_1000_TX`` and ``IFM_1000_T`` are the
same value, causing a build failure. (patch by Lawrence D'Anna)
- 2160_, [Windows]: UHandle mismatch between committed vs. used physical memory_. (patch by
- 2160_, [Windows]: Handle mismatch between committed vs. used physical memory_. (patch by
Daniel Widdis)

5.9.3
Expand Down
11 changes: 4 additions & 7 deletions psutil/tests/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,10 @@ def test_free_phymem(self):
delta=TOLERANCE_SYS_MEM)

def test_total_swapmem(self):
if (psutil.swap_memory().total > 0):
w = wmi.WMI().Win32_PerfRawData_PerfOS_Memory()[0]
self.assertEqual(int(w.CommitLimit)
- psutil.virtual_memory().total,
psutil.swap_memory().total)
else:
self.assertEqual(0, psutil.swap_memory().total)
w = wmi.WMI().Win32_PerfRawData_PerfOS_Memory()[0]
self.assertEqual(int(w.CommitLimit) - psutil.virtual_memory().total,
psutil.swap_memory().total)
if (psutil.swap_memory().total == 0):
self.assertEqual(0, psutil.swap_memory().free)
self.assertEqual(0, psutil.swap_memory().used)

Expand Down

0 comments on commit 00724f0

Please sign in to comment.