diff --git a/IPython/core/tests/test_oinspect.py b/IPython/core/tests/test_oinspect.py index c992620..cd38e09 100644 --- a/IPython/core/tests/test_oinspect.py +++ b/IPython/core/tests/test_oinspect.py @@ -8,17 +8,13 @@ from inspect import signature, Signature, Parameter import os import re -import sys import nose.tools as nt from .. import oinspect -from IPython.core.magic import (Magics, magics_class, line_magic, - cell_magic, line_cell_magic, - register_line_magic, register_cell_magic, - register_line_cell_magic) + from decorator import decorator -from IPython import get_ipython + from IPython.testing.tools import AssertPrints, AssertNotPrints from IPython.utils.path import compress_user @@ -38,7 +34,7 @@ ip = get_ipython() # defined, if any code is inserted above, the following line will need to be # updated. Do NOT insert any whitespace between the next line and the function # definition below. -THIS_LINE_NUMBER = 41 # Put here the actual number of this line +THIS_LINE_NUMBER = 37 # Put here the actual number of this line from unittest import TestCase @@ -127,48 +123,6 @@ class SimpleClass(object): """Some method's docstring""" -class OldStyle: - """An old-style class for testing.""" - pass - - -def f(x, y=2, *a, **kw): - """A simple function.""" - - -def g(y, z=3, *a, **kw): - pass # no docstring - - -@register_line_magic -def lmagic(line): - "A line magic" - - -@register_cell_magic -def cmagic(line, cell): - "A cell magic" - - -@register_line_cell_magic -def lcmagic(line, cell=None): - "A line/cell magic" - - -@magics_class -class SimpleMagics(Magics): - @line_magic - def Clmagic(self, cline): - "A class-based line magic" - - @cell_magic - def Ccmagic(self, cline, ccell): - "A class-based cell magic" - - @line_cell_magic - def Clcmagic(self, cline, ccell=None): - "A class-based line/cell magic" - class Awkward(object): def __getattr__(self, name): @@ -261,9 +215,12 @@ def test_info_serialliar(): # infinite loops: https://github.com/ipython/ipython/issues/9122 nt.assert_less(fib_tracker[0], 9000) +def support_function_one(x, y=2, *a, **kw): + """A simple function.""" + def test_calldef_none(): # We should ignore __call__ for all of these. - for obj in [f, SimpleClass().method, any, str.upper]: + for obj in [support_function_one, SimpleClass().method, any, str.upper]: print(obj) i = inspector.info(obj) nt.assert_is(i['call_def'], None)