summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-11 18:29:13 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-02-11 18:29:13 +0100
commitacfacb47e57df79f0177e5ec3ae79c37d7dea8e3 (patch)
tree91c04ebfa17d63051ee9af1d5f3ecff7fbf0ed83
parentf32512ab3abe40619f891dc96dd407a2bc59fd3c (diff)
downloadpsutil-acfacb47e57df79f0177e5ec3ae79c37d7dea8e3.tar.gz
try to fix travis test
-rwxr-xr-xpsutil/tests/test_linux.py3
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)]