From d6e8c91cc8d4cf173f7378eba69bcf1e933dd879 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sat, 10 Aug 2013 10:42:59 +0200 Subject: MAINT: remove unused and broken parts of numpy.testing Deprecate np.testing.importall - it's pointless and partially broken. --- numpy/testing/numpytest.py | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'numpy/testing/numpytest.py') diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index 4fa9364b1..2120975df 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -1,36 +1,20 @@ from __future__ import division, absolute_import, print_function import os -import sys -import traceback +import warnings -__all__ = ['IgnoreException', 'importall',] +__all__ = ['importall'] -DEBUG=0 -get_frame = sys._getframe - -class IgnoreException(Exception): - "Ignoring this exception due to disabled feature" - - -def output_exception(printstream = sys.stdout): - try: - type, value, tb = sys.exc_info() - info = traceback.extract_tb(tb) - #this is more verbose - #traceback.print_exc() - filename, lineno, function, text = info[-1] # last line only - msg = "%s:%d: %s: %s (in %s)\n" % ( - filename, lineno, type.__name__, str(value), function) - printstream.write(msg) - finally: - type = value = tb = None # clean up - return def importall(package): """ + `importall` is DEPRECATED and will be removed in numpy 1.9.0 + Try recursively to import all subpackages under package. """ + warnings.warn("`importall is deprecated, and will be remobed in numpy 1.9.0", + DeprecationWarning) + if isinstance(package,str): package = __import__(package) -- cgit v1.2.1