summaryrefslogtreecommitdiff
path: root/scipy/test/testing.py
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2005-12-16 10:20:34 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2005-12-16 10:20:34 +0000
commit625ee58c1634debfd5e49b0de631eaf27ab4ae8f (patch)
tree96eaf26bd672acbe14b49d7d078841e71949ff5d /scipy/test/testing.py
parent83015dfad2fc91ddcc0358d1e7d0b7538e647d29 (diff)
downloadnumpy-625ee58c1634debfd5e49b0de631eaf27ab4ae8f.tar.gz
Fixed test method when using subpackages as standalone.
Diffstat (limited to 'scipy/test/testing.py')
-rw-r--r--scipy/test/testing.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scipy/test/testing.py b/scipy/test/testing.py
index a16fea687..7272c9cd0 100644
--- a/scipy/test/testing.py
+++ b/scipy/test/testing.py
@@ -252,7 +252,11 @@ class ScipyTest:
Also old styled test_suite(level=1) hooks are supported but
soon to be removed.
"""
- def __init__(self, package='__main__'):
+ def __init__(self, package=None):
+ if package is None:
+ from scipy.distutils.misc_util import get_frame
+ f = get_frame(1)
+ package = f.f_locals['__name__']
self.package = package
def _module_str(self, module):
@@ -378,8 +382,9 @@ class ScipyTest:
suites = []
for name, module in sys.modules.items():
if package_name != name[:len(package_name)] \
- or module is None \
- or os.path.basename(os.path.dirname(module.__file__))=='tests':
+ or module is None:
+ continue
+ if os.path.basename(os.path.dirname(module.__file__))=='tests':
continue
suites.extend(self._get_module_tests(module, level, verbosity))