Show More
@@ -11,7 +11,7 b'' | |||
|
11 | 11 | # Imports |
|
12 | 12 | #----------------------------------------------------------------------------- |
|
13 | 13 | |
|
14 | import nose.tools as nt | |
|
14 | import pytest | |
|
15 | 15 | |
|
16 | 16 | from IPython.utils.importstring import import_item |
|
17 | 17 | |
@@ -22,18 +22,19 b' from IPython.utils.importstring import import_item' | |||
|
22 | 22 | def test_import_plain(): |
|
23 | 23 | "Test simple imports" |
|
24 | 24 | import os |
|
25 | os2 = import_item('os') | |
|
26 | nt.assert_true(os is os2) | |
|
25 | ||
|
26 | os2 = import_item("os") | |
|
27 | assert os is os2 | |
|
27 | 28 | |
|
28 | 29 | |
|
29 | 30 | def test_import_nested(): |
|
30 | 31 | "Test nested imports from the stdlib" |
|
31 | 32 | from os import path |
|
32 | path2 = import_item('os.path') | |
|
33 | nt.assert_true(path is path2) | |
|
33 | ||
|
34 | path2 = import_item("os.path") | |
|
35 | assert path is path2 | |
|
34 | 36 | |
|
35 | 37 | |
|
36 | 38 | def test_import_raises(): |
|
37 | 39 | "Test that failing imports raise the right exception" |
|
38 |
|
|
|
39 | ||
|
40 | pytest.raises(ImportError, import_item, "IPython.foobar") |
General Comments 0
You need to be logged in to leave comments.
Login now