diff --git a/tests/unittests.ipynb b/tests/unittests.ipynb index 651c5a4..d38f936 100644 --- a/tests/unittests.ipynb +++ b/tests/unittests.ipynb @@ -9,16 +9,7 @@ " from unittest import TestCase, expectedFailure, skipUnless\n", " from IPython import get_ipython\n", " from IPython.utils.capture import capture_output\n", - " from importnb import Notebook, reload, Partial" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - " skipIPython = skipUnless(get_ipython(), \"\"\"IPython is not available\"\"\")" + " from importnb import Notebook, reload, Partial, load_ipython_extension, unload_ipython_extension" ] }, { @@ -31,9 +22,9 @@ " def setUp(Test):\n", " if get_ipython():\n", " %reload_ext importnb\n", - " else: ...\n", + " else: \n", + " load_ipython_extension()\n", " \n", - " @skipIPython\n", " def test_import(Test):\n", " try:\n", " from . import loader\n", @@ -44,7 +35,6 @@ " assert loader.test is 42\n", " assert isinstance(loader, __import__('types').ModuleType)\n", " \n", - " @skipIPython\n", " @expectedFailure\n", " def test_failure(Test):\n", " from . import failure\n", @@ -52,7 +42,8 @@ " def tearDown(Test):\n", " if get_ipython():\n", " %unload_ext importnb\n", - " else: ...\n" + " else: \n", + " unload_ipython_extension()\n" ] }, { @@ -114,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "scrolled": false }, @@ -124,7 +115,19 @@ "output_type": "stream", "text": [ "Test IPython \n", - "\n" + "\n", + "..xx..\n", + "----------------------------------------------------------------------\n", + "Ran 6 tests in 2.013s\n", + "\n", + "OK (expected failures=2)\n", + "\u001b]0;IPython: importnb/tests\u0007Test Python \n", + "\n", + "..xss.\n", + "----------------------------------------------------------------------\n", + "Ran 6 tests in 2.016s\n", + "\n", + "OK (skipped=2, expected failures=1)\n" ] } ],