##// END OF EJS Templates
Merge pull request #10039 from Carreau/deprecation-warnings...
Thomas Kluyver -
r22995:bac02d02 merge
parent child Browse files
Show More
@@ -63,7 +63,7 b' def BdbQuit_excepthook(et, ev, tb, excepthook=None):'
63 parameter.
63 parameter.
64 """
64 """
65 warnings.warn("`BdbQuit_excepthook` is deprecated since version 5.1",
65 warnings.warn("`BdbQuit_excepthook` is deprecated since version 5.1",
66 DeprecationWarning)
66 DeprecationWarning, stacklevel=2)
67 if et==bdb.BdbQuit:
67 if et==bdb.BdbQuit:
68 print('Exiting Debugger.')
68 print('Exiting Debugger.')
69 elif excepthook is not None:
69 elif excepthook is not None:
@@ -76,7 +76,7 b' def BdbQuit_excepthook(et, ev, tb, excepthook=None):'
76 def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None):
76 def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None):
77 warnings.warn(
77 warnings.warn(
78 "`BdbQuit_IPython_excepthook` is deprecated since version 5.1",
78 "`BdbQuit_IPython_excepthook` is deprecated since version 5.1",
79 DeprecationWarning)
79 DeprecationWarning, stacklevel=2)
80 print('Exiting Debugger.')
80 print('Exiting Debugger.')
81
81
82
82
@@ -128,7 +128,7 b' class Tracer(object):'
128 """
128 """
129 warnings.warn("`Tracer` is deprecated since version 5.1, directly use "
129 warnings.warn("`Tracer` is deprecated since version 5.1, directly use "
130 "`IPython.core.debugger.Pdb.set_trace()`",
130 "`IPython.core.debugger.Pdb.set_trace()`",
131 DeprecationWarning)
131 DeprecationWarning, stacklevel=2)
132
132
133 ip = get_ipython()
133 ip = get_ipython()
134 if ip is None:
134 if ip is None:
@@ -165,7 +165,8 b' class Deprec(object):'
165
165
166 def __getattr__(self, name):
166 def __getattr__(self, name):
167 val = getattr(self.wrapped, name)
167 val = getattr(self.wrapped, name)
168 warnings.warn("Using ExceptionColors global is deprecated and will be removed in IPython 6.0", DeprecationWarning)
168 warnings.warn("Using ExceptionColors global is deprecated and will be removed in IPython 6.0",
169 DeprecationWarning, stacklevel=2)
169 # using getattr after warnings break ipydoctest in weird way for 3.5
170 # using getattr after warnings break ipydoctest in weird way for 3.5
170 return val
171 return val
171
172
@@ -658,7 +658,9 b' guis = inputhook_manager.guihooks'
658
658
659
659
660 def _deprecated_disable():
660 def _deprecated_disable():
661 warn("This function is deprecated since IPython 4.0 use disable_gui() instead", DeprecationWarning)
661 warn("This function is deprecated since IPython 4.0 use disable_gui() instead",
662 DeprecationWarning, stacklevel=2)
662 inputhook_manager.disable_gui()
663 inputhook_manager.disable_gui()
664
663 disable_wx = disable_qt4 = disable_gtk = disable_gtk3 = disable_glut = \
665 disable_wx = disable_qt4 = disable_gtk = disable_gtk3 = disable_glut = \
664 disable_pyglet = disable_osx = _deprecated_disable
666 disable_pyglet = disable_osx = _deprecated_disable
@@ -68,7 +68,7 b' def as_unittest(func):'
68
68
69 # Utility functions
69 # Utility functions
70
70
71 def apply_wrapper(wrapper,func):
71 def apply_wrapper(wrapper, func):
72 """Apply a wrapper to a function for decoration.
72 """Apply a wrapper to a function for decoration.
73
73
74 This mixes Michele Simionato's decorator tool with nose's make_decorator,
74 This mixes Michele Simionato's decorator tool with nose's make_decorator,
@@ -77,14 +77,14 b' def apply_wrapper(wrapper,func):'
77 This will ensure that wrapped functions can still be well introspected via
77 This will ensure that wrapped functions can still be well introspected via
78 IPython, for example.
78 IPython, for example.
79 """
79 """
80 warnings.warn("The function `apply_wrapper` is deprecated and might be removed in IPython 5.0", DeprecationWarning)
80 warnings.warn("The function `apply_wrapper` is deprecated since IPython 4.0",
81
81 DeprecationWarning, stacklevel=2)
82 import nose.tools
82 import nose.tools
83
83
84 return decorator(wrapper,nose.tools.make_decorator(func)(wrapper))
84 return decorator(wrapper,nose.tools.make_decorator(func)(wrapper))
85
85
86
86
87 def make_label_dec(label,ds=None):
87 def make_label_dec(label, ds=None):
88 """Factory function to create a decorator that applies one or more labels.
88 """Factory function to create a decorator that applies one or more labels.
89
89
90 Parameters
90 Parameters
@@ -129,7 +129,8 b' def make_label_dec(label,ds=None):'
129 True
129 True
130 """
130 """
131
131
132 warnings.warn("The function `make_label_dec` is deprecated and might be removed in IPython 5.0", DeprecationWarning)
132 warnings.warn("The function `make_label_dec` is deprecated since IPython 4.0",
133 DeprecationWarning, stacklevel=2)
133 if isinstance(label, string_types):
134 if isinstance(label, string_types):
134 labels = [label]
135 labels = [label]
135 else:
136 else:
@@ -285,7 +286,8 b' def decorated_dummy(dec, name):'
285 import IPython.testing.decorators as dec
286 import IPython.testing.decorators as dec
286 setup = dec.decorated_dummy(dec.skip_if_no_x11, __name__)
287 setup = dec.decorated_dummy(dec.skip_if_no_x11, __name__)
287 """
288 """
288 warnings.warn("The function `make_label_dec` is deprecated and might be removed in IPython 5.0", DeprecationWarning)
289 warnings.warn("The function `decorated_dummy` is deprecated since IPython 4.0",
290 DeprecationWarning, stacklevel=2)
289 dummy = lambda: None
291 dummy = lambda: None
290 dummy.__name__ = name
292 dummy.__name__ = name
291 return dec(dummy)
293 return dec(dummy)
@@ -318,7 +320,8 b' skip_if_no_x11 = skipif(_x11_skip_cond, _x11_skip_msg)'
318
320
319 # not a decorator itself, returns a dummy function to be used as setup
321 # not a decorator itself, returns a dummy function to be used as setup
320 def skip_file_no_x11(name):
322 def skip_file_no_x11(name):
321 warnings.warn("The function `skip_file_no_x11` is deprecated and might be removed in IPython 5.0", DeprecationWarning)
323 warnings.warn("The function `skip_file_no_x11` is deprecated since IPython 4.0",
324 DeprecationWarning, stacklevel=2)
322 return decorated_dummy(skip_if_no_x11, name) if _x11_skip_cond else None
325 return decorated_dummy(skip_if_no_x11, name) if _x11_skip_cond else None
323
326
324 # Other skip decorators
327 # Other skip decorators
@@ -366,7 +369,8 b' def onlyif_any_cmd_exists(*commands):'
366 """
369 """
367 Decorator to skip test unless at least one of `commands` is found.
370 Decorator to skip test unless at least one of `commands` is found.
368 """
371 """
369 warnings.warn("The function `onlyif_any_cmd_exists` is deprecated and might be removed in IPython 5.0", DeprecationWarning)
372 warnings.warn("The function `onlyif_any_cmd_exists` is deprecated since IPython 4.0",
373 DeprecationWarning, stacklevel=2)
370 for cmd in commands:
374 for cmd in commands:
371 if which(cmd):
375 if which(cmd):
372 return null_deco
376 return null_deco
@@ -48,6 +48,16 b" warnings.filterwarnings('error', message='.*', category=ResourceWarning, module="
48 warnings.filterwarnings('error', message=".*{'config': True}.*", category=DeprecationWarning, module='IPy.*')
48 warnings.filterwarnings('error', message=".*{'config': True}.*", category=DeprecationWarning, module='IPy.*')
49 warnings.filterwarnings('default', message='.*', category=Warning, module='IPy.*')
49 warnings.filterwarnings('default', message='.*', category=Warning, module='IPy.*')
50
50
51 warnings.filterwarnings('error', message='.*apply_wrapper.*', category=DeprecationWarning, module='.*')
52 warnings.filterwarnings('error', message='.*make_label_dec', category=DeprecationWarning, module='.*')
53 warnings.filterwarnings('error', message='.*decorated_dummy.*', category=DeprecationWarning, module='.*')
54 warnings.filterwarnings('error', message='.*skip_file_no_x11.*', category=DeprecationWarning, module='.*')
55 warnings.filterwarnings('error', message='.*onlyif_any_cmd_exists.*', category=DeprecationWarning, module='.*')
56
57 warnings.filterwarnings('error', message='.*disable_gui.*', category=DeprecationWarning, module='.*')
58
59 warnings.filterwarnings('error', message='.*ExceptionColors global is deprecated.*', category=DeprecationWarning, module='.*')
60
51 if version_info < (6,):
61 if version_info < (6,):
52 # nose.tools renames all things from `camelCase` to `snake_case` which raise an
62 # nose.tools renames all things from `camelCase` to `snake_case` which raise an
53 # warning with the runner they also import from standard import library. (as of Dec 2015)
63 # warning with the runner they also import from standard import library. (as of Dec 2015)
General Comments 0
You need to be logged in to leave comments. Login now