Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 329ebac

Browse files
committed
update some test skips for removed packages
1 parent d163089 commit 329ebac

4 files changed

Lines changed: 14 additions & 19 deletions

File tree

IPython/core/tests/test_display.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ def test_image_filename_defaults():
5050
embed=True)
5151
nt.assert_raises(ValueError, display.Image)
5252
nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True)
53-
from IPython.html import DEFAULT_STATIC_FILES_PATH
5453
# check boths paths to allow packages to test at build and install time
55-
imgfile = os.path.join(tpath, 'html/static/base/images/logo.png')
56-
if not os.path.exists(imgfile):
57-
imgfile = os.path.join(DEFAULT_STATIC_FILES_PATH, 'base/images/logo.png')
54+
imgfile = os.path.join(tpath, 'core/tests/2x2.png')
5855
img = display.Image(filename=imgfile)
5956
nt.assert_equal('png', img.format)
6057
nt.assert_is_not_none(img._repr_png_())

IPython/core/tests/test_magic.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,16 @@ def test_extension():
619619
tmpdir.cleanup()
620620

621621

622-
# The nose skip decorator doesn't work on classes, so this uses unittest's skipIf
623-
@skipIf(dec.module_not_available('IPython.nbformat'), 'nbformat not importable')
624-
class NotebookExportMagicTests(TestCase):
625-
def test_notebook_export_json(self):
626-
_ip = get_ipython()
627-
_ip.history_manager.reset() # Clear any existing history.
628-
cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"]
629-
for i, cmd in enumerate(cmds, start=1):
630-
_ip.history_manager.store_inputs(i, cmd)
631-
with TemporaryDirectory() as td:
632-
outfile = os.path.join(td, "nb.ipynb")
633-
_ip.magic("notebook -e %s" % outfile)
622+
@dec.skip_without('jupyter_nbformat')
623+
def test_notebook_export_json():
624+
_ip = get_ipython()
625+
_ip.history_manager.reset() # Clear any existing history.
626+
cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"]
627+
for i, cmd in enumerate(cmds, start=1):
628+
_ip.history_manager.store_inputs(i, cmd)
629+
with TemporaryDirectory() as td:
630+
outfile = os.path.join(td, "nb.ipynb")
631+
_ip.magic("notebook -e %s" % outfile)
634632

635633

636634
class TestEnv(TestCase):

IPython/core/tests/test_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,10 @@ def test_ignore_sys_exit(self):
375375
with tt.AssertNotPrints('SystemExit'):
376376
_ip.magic('run -e %s' % self.fname)
377377

378-
@dec.skip_without('IPython.nbformat') # Requires jsonschema
378+
@dec.skip_without('jupyter_nbformat') # Requires jsonschema
379379
def test_run_nb(self):
380380
"""Test %run notebook.ipynb"""
381-
from IPython.nbformat import v4, writes
381+
from jupyter_nbformat import v4, writes
382382
nb = v4.new_notebook(
383383
cells=[
384384
v4.new_markdown_cell("The Ultimate Question of Everything"),

IPython/terminal/tests/test_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ def test_locate_help():
2525
def test_locate_profile_help():
2626
tt.help_all_output_test("locate profile")
2727

28-
@skip_without('IPython.nbformat') # Requires jsonschema to be installed
28+
@skip_without('jupyter_nbformat') # Requires jsonschema to be installed
2929
def test_trust_help():
3030
tt.help_all_output_test("trust")

0 commit comments

Comments
 (0)