diff options
author | Jarrod Millman <millman@berkeley.edu> | 2007-11-28 05:12:37 +0000 |
---|---|---|
committer | Jarrod Millman <millman@berkeley.edu> | 2007-11-28 05:12:37 +0000 |
commit | 6c00b1141fdfa7d168a9b82e6ab493c77f7c1621 (patch) | |
tree | 0e9b0714a7d0a5e83ca3d321b4d9aca588347f4a /numpy/testing/numpytest.py | |
parent | 3fe715c0d0deb78ace46c3dbaf3165e8c4283e3c (diff) | |
download | numpy-6c00b1141fdfa7d168a9b82e6ab493c77f7c1621.tar.gz |
use 'in' keyword to test dictionary membership
Diffstat (limited to 'numpy/testing/numpytest.py')
-rw-r--r-- | numpy/testing/numpytest.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index 3ea5686aa..68d64827b 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -379,7 +379,7 @@ class NumpyTest: test_dir_module = parent_module_name+'.tests' test_module_name = test_dir_module+'.'+test_module_name - if not sys.modules.has_key(test_dir_module): + if test_dir_module not in sys.modules: sys.modules[test_dir_module] = imp.new_module(test_dir_module) old_sys_path = sys.path[:] @@ -463,7 +463,8 @@ class NumpyTest: d = os.path.join(d, 'tests') if not os.path.isdir(d): continue - if test_dirs_names.has_key(d): continue + if d in test_dirs_names: + continue test_dir_module = '.'.join(name.split('.')[:-1]+['tests']) test_dirs_names[d] = test_dir_module @@ -477,7 +478,7 @@ class NumpyTest: for test_dir in test_dirs: test_dir_module = test_dirs_names[test_dir] - if not sys.modules.has_key(test_dir_module): + if test_dir_module not in sys.modules: sys.modules[test_dir_module] = imp.new_module(test_dir_module) for fn in os.listdir(test_dir): |