diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index 17d50096c..097806361 100644 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -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)