diff options
Diffstat (limited to 'psutil/tests')
-rwxr-xr-x | psutil/tests/test_linux.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index 4736bd6b..5a48a445 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -1070,6 +1070,9 @@ class TestSystemDiskPartitions(unittest.TestCase): @unittest.skipIf(not os.path.exists('/proc/swaps'), "/proc/swaps not available") def test_swap(self): + with open('/proc/swaps') as f: + if not f.readline() or not f.readlines(): + raise self.skipTest("/proc/swaps is empty") types = [x.fstype for x in psutil.disk_partitions(all=False)] self.assertNotIn('swap', types) types = [x.fstype for x in psutil.disk_partitions(all=True)] |