diff --git a/IPython/core/tests/test_oinspect.py b/IPython/core/tests/test_oinspect.py index d01d0dd..1d7f7bc 100644 --- a/IPython/core/tests/test_oinspect.py +++ b/IPython/core/tests/test_oinspect.py @@ -28,6 +28,7 @@ from IPython.core.magic import (Magics, magics_class, line_magic, register_line_cell_magic) from IPython.external.decorator import decorator from IPython.testing.decorators import skipif +from IPython.testing.tools import AssertPrints from IPython.utils.path import compress_user from IPython.utils import py3compat @@ -47,7 +48,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 = 50 # Put here the actual number of this line +THIS_LINE_NUMBER = 51 # Put here the actual number of this line def test_find_source_lines(): nt.assert_equal(oinspect.find_source_lines(test_find_source_lines), THIS_LINE_NUMBER+1) @@ -372,3 +373,10 @@ def test_pinfo_nonascii(): from . import nonascii2 ip.user_ns['nonascii2'] = nonascii2 ip._inspect('pinfo', 'nonascii2', detail_level=1) + +def test_pinfo_magic(): + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'lsmagic', detail_level=0) + + with AssertPrints('Source:'): + ip._inspect('pinfo', 'lsmagic', detail_level=1)