diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2015-07-09 11:43:48 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2015-07-09 11:43:48 +0200 |
commit | 192aa78c90253bede27b2745d4e80aeed79a3aef (patch) | |
tree | 3288344a8695ac4fd53162546fb051229c921e4d /test/_sunos.py | |
parent | a6cb7f927f40bd129f31493c37dfe7d0d6f6a070 (diff) | |
parent | 73f54f47a7d4eac329c27af71c7fc5ad432d2e84 (diff) | |
download | psutil-get_open_files_thread.tar.gz |
Merge branch 'master' into get_open_files_threadget_open_files_thread
Diffstat (limited to 'test/_sunos.py')
-rw-r--r-- | test/_sunos.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/_sunos.py b/test/_sunos.py index 7fdc50b6..3d54ccd8 100644 --- a/test/_sunos.py +++ b/test/_sunos.py @@ -7,15 +7,17 @@ """Sun OS specific tests. These are implicitly run by test_psutil.py.""" import sys +import os -from test_psutil import sh, unittest +from test_psutil import SUNOS, sh, unittest import psutil +@unittest.skipUnless(SUNOS, "not a SunOS system") class SunOSSpecificTestCase(unittest.TestCase): def test_swap_memory(self): - out = sh('swap -l -k') + out = sh('env PATH=/usr/sbin:/sbin:%s swap -l -k' % os.environ['PATH']) lines = out.strip().split('\n')[1:] if not lines: raise ValueError('no swap device(s) configured') @@ -35,12 +37,12 @@ class SunOSSpecificTestCase(unittest.TestCase): self.assertEqual(psutil_swap.free, free) -def test_main(): +def main(): test_suite = unittest.TestSuite() test_suite.addTest(unittest.makeSuite(SunOSSpecificTestCase)) result = unittest.TextTestRunner(verbosity=2).run(test_suite) return result.wasSuccessful() if __name__ == '__main__': - if not test_main(): + if not main(): sys.exit(1) |