diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2015-07-15 14:21:13 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2015-07-15 14:21:13 +0200 |
commit | c36da6a78edacc4ce684d8d435ba33b316f35f62 (patch) | |
tree | e9422005662da838d23a3000c4f4b409e357513a | |
parent | d7de0fdaab7bcffc2e201b3f868afd0886868e02 (diff) | |
download | psutil-c36da6a78edacc4ce684d8d435ba33b316f35f62.tar.gz |
#656 fix test
-rw-r--r-- | test/test_psutil.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_psutil.py b/test/test_psutil.py index 0ec756f6..3df30203 100644 --- a/test/test_psutil.py +++ b/test/test_psutil.py @@ -2747,7 +2747,8 @@ class TestMisc(unittest.TestCase): self.assertEqual(len(s), 1) def test__all__(self): - for name in dir(psutil): + dir_psutil = dir(psutil) + for name in dir_psutil: if name in ('callable', 'error', 'namedtuple', 'long', 'test', 'NUM_CPUS', 'BOOT_TIME', 'TOTAL_PHYMEM'): @@ -2763,9 +2764,13 @@ class TestMisc(unittest.TestCase): if (fun.__doc__ is not None and 'deprecated' not in fun.__doc__.lower()): self.fail('%r not in psutil.__all__' % name) - # import 'star' will break if __all__ is inconsistent, see: + + # Import 'star' will break if __all__ is inconsistent, see: # https://github.com/giampaolo/psutil/issues/656 - from psutil import * # NOQA + # Can't do `from psutil import *` as it won't work on python 3 + # so we simply iterate over __all__. + for name in psutil.__all__: + self.assertIn(name, dir_psutil) def test_memoize(self): from psutil._common import memoize |