##// END OF EJS Templates
[utils][tests][module_paths] Remove nose
Samuel Gaist -
Show More
@@ -22,8 +22,6 b' from IPython.testing.tools import make_tempfile'
22
22
23 import IPython.utils.module_paths as mp
23 import IPython.utils.module_paths as mp
24
24
25 import nose.tools as nt
26
27 TEST_FILE_PATH = Path(__file__).resolve().parent
25 TEST_FILE_PATH = Path(__file__).resolve().parent
28
26
29 TMP_TEST_DIR = Path(tempfile.mkdtemp(suffix="with.dot"))
27 TMP_TEST_DIR = Path(tempfile.mkdtemp(suffix="with.dot"))
@@ -67,7 +65,7 b' def test_tempdir():'
67 """
65 """
68 Ensure the test are done with a temporary file that have a dot somewhere.
66 Ensure the test are done with a temporary file that have a dot somewhere.
69 """
67 """
70 nt.assert_in(".", str(TMP_TEST_DIR))
68 assert "." in str(TMP_TEST_DIR)
71
69
72
70
73 def test_find_mod_1():
71 def test_find_mod_1():
@@ -76,7 +74,7 b' def test_find_mod_1():'
76 Expected output: a path to that directory's __init__.py file.
74 Expected output: a path to that directory's __init__.py file.
77 """
75 """
78 modpath = TMP_TEST_DIR / "xmod" / "__init__.py"
76 modpath = TMP_TEST_DIR / "xmod" / "__init__.py"
79 nt.assert_equal(Path(mp.find_mod("xmod")), modpath)
77 assert Path(mp.find_mod("xmod")) == modpath
80
78
81 def test_find_mod_2():
79 def test_find_mod_2():
82 """
80 """
@@ -85,7 +83,7 b' def test_find_mod_2():'
85 TODO: Confirm why this is a duplicate test.
83 TODO: Confirm why this is a duplicate test.
86 """
84 """
87 modpath = TMP_TEST_DIR / "xmod" / "__init__.py"
85 modpath = TMP_TEST_DIR / "xmod" / "__init__.py"
88 nt.assert_equal(Path(mp.find_mod("xmod")), modpath)
86 assert Path(mp.find_mod("xmod")) == modpath
89
87
90 def test_find_mod_3():
88 def test_find_mod_3():
91 """
89 """
@@ -93,7 +91,7 b' def test_find_mod_3():'
93 Expected output: full path with .py extension.
91 Expected output: full path with .py extension.
94 """
92 """
95 modpath = TMP_TEST_DIR / "xmod" / "sub.py"
93 modpath = TMP_TEST_DIR / "xmod" / "sub.py"
96 nt.assert_equal(Path(mp.find_mod("xmod.sub")), modpath)
94 assert Path(mp.find_mod("xmod.sub")) == modpath
97
95
98 def test_find_mod_4():
96 def test_find_mod_4():
99 """
97 """
@@ -101,11 +99,11 b' def test_find_mod_4():'
101 Expected output: full path with .py extension
99 Expected output: full path with .py extension
102 """
100 """
103 modpath = TMP_TEST_DIR / "pack.py"
101 modpath = TMP_TEST_DIR / "pack.py"
104 nt.assert_equal(Path(mp.find_mod("pack")), modpath)
102 assert Path(mp.find_mod("pack")) == modpath
105
103
106 def test_find_mod_5():
104 def test_find_mod_5():
107 """
105 """
108 Search for a filename with a .pyc extension
106 Search for a filename with a .pyc extension
109 Expected output: TODO: do we exclude or include .pyc files?
107 Expected output: TODO: do we exclude or include .pyc files?
110 """
108 """
111 nt.assert_equal(mp.find_mod("packpyc"), None)
109 assert mp.find_mod("packpyc") == None
General Comments 0
You need to be logged in to leave comments. Login now