Skip to content

Commit

Permalink
#656 fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jul 15, 2015
1 parent d7de0fd commit c36da6a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/test_psutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,8 @@ def test_process__hash__(self):
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'):
Expand All @@ -2763,9 +2764,13 @@ def test__all__(self):
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
Expand Down

0 comments on commit c36da6a

Please sign in to comment.