diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 14:04:13 -0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 14:04:13 -0800 |
commit | 8daac74154f23bf1c663a90c95839b6eefe3dc6c (patch) | |
tree | cb46fc9c1d42d7681a79be303292ee47b33d40b9 /psutil/tests/test_linux.py | |
parent | 6233060092bf3822c2d6252ebe5a6ac521f7795c (diff) | |
parent | 24eb30167d5e9ec2d939bf80fccea239bac4458e (diff) | |
download | psutil-pypy.tar.gz |
Merge branch 'pypy' of https://github.com/giampaolo/psutil into pypypypy
Diffstat (limited to 'psutil/tests/test_linux.py')
-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)] |