Show More
@@ -50,11 +50,8 b' def test_image_filename_defaults():' | |||||
50 | embed=True) |
|
50 | embed=True) | |
51 | nt.assert_raises(ValueError, display.Image) |
|
51 | nt.assert_raises(ValueError, display.Image) | |
52 | nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True) |
|
52 | 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 |
|
|||
54 | # check boths paths to allow packages to test at build and install time |
|
53 | # check boths paths to allow packages to test at build and install time | |
55 |
imgfile = os.path.join(tpath, ' |
|
54 | imgfile = os.path.join(tpath, 'core/tests/2x2.png') | |
56 | if not os.path.exists(imgfile): |
|
|||
57 | imgfile = os.path.join(DEFAULT_STATIC_FILES_PATH, 'base/images/logo.png') |
|
|||
58 | img = display.Image(filename=imgfile) |
|
55 | img = display.Image(filename=imgfile) | |
59 | nt.assert_equal('png', img.format) |
|
56 | nt.assert_equal('png', img.format) | |
60 | nt.assert_is_not_none(img._repr_png_()) |
|
57 | nt.assert_is_not_none(img._repr_png_()) |
@@ -619,18 +619,16 b' def test_extension():' | |||||
619 | tmpdir.cleanup() |
|
619 | tmpdir.cleanup() | |
620 |
|
620 | |||
621 |
|
621 | |||
622 | # The nose skip decorator doesn't work on classes, so this uses unittest's skipIf |
|
622 | @dec.skip_without('jupyter_nbformat') | |
623 | @skipIf(dec.module_not_available('IPython.nbformat'), 'nbformat not importable') |
|
623 | def test_notebook_export_json(): | |
624 | class NotebookExportMagicTests(TestCase): |
|
624 | _ip = get_ipython() | |
625 | def test_notebook_export_json(self): |
|
625 | _ip.history_manager.reset() # Clear any existing history. | |
626 | _ip = get_ipython() |
|
626 | cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"] | |
627 | _ip.history_manager.reset() # Clear any existing history. |
|
627 | for i, cmd in enumerate(cmds, start=1): | |
628 | cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"] |
|
628 | _ip.history_manager.store_inputs(i, cmd) | |
629 | for i, cmd in enumerate(cmds, start=1): |
|
629 | with TemporaryDirectory() as td: | |
630 | _ip.history_manager.store_inputs(i, cmd) |
|
630 | outfile = os.path.join(td, "nb.ipynb") | |
631 | with TemporaryDirectory() as td: |
|
631 | _ip.magic("notebook -e %s" % outfile) | |
632 | outfile = os.path.join(td, "nb.ipynb") |
|
|||
633 | _ip.magic("notebook -e %s" % outfile) |
|
|||
634 |
|
632 | |||
635 |
|
633 | |||
636 | class TestEnv(TestCase): |
|
634 | class TestEnv(TestCase): |
@@ -375,10 +375,10 b' tclass.py: deleting object: C-third' | |||||
375 | with tt.AssertNotPrints('SystemExit'): |
|
375 | with tt.AssertNotPrints('SystemExit'): | |
376 | _ip.magic('run -e %s' % self.fname) |
|
376 | _ip.magic('run -e %s' % self.fname) | |
377 |
|
377 | |||
378 |
@dec.skip_without(' |
|
378 | @dec.skip_without('jupyter_nbformat') # Requires jsonschema | |
379 | def test_run_nb(self): |
|
379 | def test_run_nb(self): | |
380 | """Test %run notebook.ipynb""" |
|
380 | """Test %run notebook.ipynb""" | |
381 |
from |
|
381 | from jupyter_nbformat import v4, writes | |
382 | nb = v4.new_notebook( |
|
382 | nb = v4.new_notebook( | |
383 | cells=[ |
|
383 | cells=[ | |
384 | v4.new_markdown_cell("The Ultimate Question of Everything"), |
|
384 | v4.new_markdown_cell("The Ultimate Question of Everything"), |
@@ -25,6 +25,6 b' def test_locate_help():' | |||||
25 | def test_locate_profile_help(): |
|
25 | def test_locate_profile_help(): | |
26 | tt.help_all_output_test("locate profile") |
|
26 | tt.help_all_output_test("locate profile") | |
27 |
|
27 | |||
28 |
@skip_without(' |
|
28 | @skip_without('jupyter_nbformat') # Requires jsonschema to be installed | |
29 | def test_trust_help(): |
|
29 | def test_trust_help(): | |
30 | tt.help_all_output_test("trust") |
|
30 | tt.help_all_output_test("trust") |
General Comments 0
You need to be logged in to leave comments.
Login now