diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index a5b2211..f7f6fef 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -34,6 +34,7 @@ from IPython.nbformat import current from IPython.testing import decorators as dec from IPython.testing import tools as tt from IPython.utils import py3compat +from IPython.utils.io import capture_output from IPython.utils.tempdir import TemporaryDirectory from IPython.utils.process import find_cmd @@ -218,6 +219,18 @@ def test_macro_run(): ip.run_cell("test") +def test_magic_magic(): + """Test %magic""" + ip = get_ipython() + with capture_output() as captured: + ip.magic("magic") + + stdout = captured.stdout + yield (nt.assert_true, '%magic' in stdout) + yield (nt.assert_true, 'IPython' in stdout) + yield (nt.assert_true, 'Available' in stdout) + + @dec.skipif_not_numpy def test_numpy_reset_array_undec(): "Test '%reset array' functionality"