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 f069638
Showing 1 changed file with 4 additions and 7 deletions.
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 f069638

Please sign in to comment.