##// END OF EJS Templates
[core][tests][profile] Remove nose
Samuel Gaist -
Show More
@@ -27,8 +27,6 b' import tempfile'
27 from pathlib import Path
27 from pathlib import Path
28 from unittest import TestCase
28 from unittest import TestCase
29
29
30 import nose.tools as nt
31
32 from IPython.core.profileapp import list_profiles_in, list_bundled_profiles
30 from IPython.core.profileapp import list_profiles_in, list_bundled_profiles
33 from IPython.core.profiledir import ProfileDir
31 from IPython.core.profiledir import ProfileDir
34
32
@@ -79,7 +77,7 b' def win32_without_pywin32():'
79 except ImportError:
77 except ImportError:
80 return True
78 return True
81 return False
79 return False
82
80
83
81
84 class ProfileStartupTest(TestCase):
82 class ProfileStartupTest(TestCase):
85 def setUp(self):
83 def setUp(self):
@@ -114,7 +112,7 b' class ProfileStartupTest(TestCase):'
114 self.init('00-start.ipy', '%xmode plain\n', '')
112 self.init('00-start.ipy', '%xmode plain\n', '')
115 self.validate('Exception reporting mode: Plain')
113 self.validate('Exception reporting mode: Plain')
116
114
117
115
118 def test_list_profiles_in():
116 def test_list_profiles_in():
119 # No need to remove these directories and files, as they will get nuked in
117 # No need to remove these directories and files, as they will get nuked in
120 # the module-level teardown.
118 # the module-level teardown.
@@ -127,7 +125,7 b' def test_list_profiles_in():'
127 with open(td / "profile_file", "w") as f:
125 with open(td / "profile_file", "w") as f:
128 f.write("I am not a profile directory")
126 f.write("I am not a profile directory")
129 profiles = list_profiles_in(td)
127 profiles = list_profiles_in(td)
130
128
131 # unicode normalization can turn u'ünicode' into u'u\0308nicode',
129 # unicode normalization can turn u'ünicode' into u'u\0308nicode',
132 # so only check for *nicode, and that creating a ProfileDir from the
130 # so only check for *nicode, and that creating a ProfileDir from the
133 # name remains valid
131 # name remains valid
@@ -139,14 +137,14 b' def test_list_profiles_in():'
139 found_unicode = True
137 found_unicode = True
140 break
138 break
141 if dec.unicode_paths:
139 if dec.unicode_paths:
142 nt.assert_true(found_unicode)
140 assert found_unicode is True
143 nt.assert_equal(set(profiles), {'foo', 'hello'})
141 assert set(profiles) == {"foo", "hello"}
144
142
145
143
146 def test_list_bundled_profiles():
144 def test_list_bundled_profiles():
147 # This variable will need to be updated when a new profile gets bundled
145 # This variable will need to be updated when a new profile gets bundled
148 bundled = sorted(list_bundled_profiles())
146 bundled = sorted(list_bundled_profiles())
149 nt.assert_equal(bundled, [])
147 assert bundled == []
150
148
151
149
152 def test_profile_create_ipython_dir():
150 def test_profile_create_ipython_dir():
@@ -167,4 +165,3 b' def test_profile_create_ipython_dir():'
167 assert Path(profile_dir).exists()
165 assert Path(profile_dir).exists()
168 ipython_config = profile_dir / "ipython_config.py"
166 ipython_config = profile_dir / "ipython_config.py"
169 assert Path(ipython_config).exists()
167 assert Path(ipython_config).exists()
170
General Comments 0
You need to be logged in to leave comments. Login now