##// END OF EJS Templates
[lib][tests][deepreload] Remove nose
Samuel Gaist -
Show More
@@ -6,8 +6,6 b''
6 6
7 7 from pathlib import Path
8 8
9 import nose.tools as nt
10
11 9 from IPython.utils.syspathcontext import prepended_to_syspath
12 10 from IPython.utils.tempdir import TemporaryDirectory
13 11 from IPython.lib.deepreload import reload as dreload
@@ -28,9 +26,9 b' def test_deepreload():'
28 26 # Test that A is not reloaded.
29 27 obj = A.Object()
30 28 dreload(B, exclude=["A"])
31 nt.assert_true(isinstance(obj, A.Object))
29 assert isinstance(obj, A.Object) is True
32 30
33 31 # Test that A is reloaded.
34 32 obj = A.Object()
35 33 dreload(B)
36 nt.assert_false(isinstance(obj, A.Object))
34 assert isinstance(obj, A.Object) is False
@@ -21,7 +21,7 b' import wave'
21 21 from io import BytesIO
22 22
23 23 # Third-party imports
24 import nose.tools as nt
24 import pytest
25 25
26 26 try:
27 27 import numpy
@@ -48,10 +48,10 b' def test_instantiation_FileLink():'
48 48 fl = display.FileLink(pathlib.PurePath('example.txt'))
49 49
50 50 def test_warning_on_non_existent_path_FileLink():
51 """FileLink: Calling _repr_html_ on non-existent files returns a warning
52 """
53 fl = display.FileLink('example.txt')
54 nt.assert_true(fl._repr_html_().startswith('Path (<tt>example.txt</tt>)'))
51 """FileLink: Calling _repr_html_ on non-existent files returns a warning"""
52 fl = display.FileLink("example.txt")
53 assert fl._repr_html_().startswith("Path (<tt>example.txt</tt>)")
54
55 55
56 56 def test_existing_path_FileLink():
57 57 """FileLink: Calling _repr_html_ functions as expected on existing filepath
@@ -77,7 +77,7 b' def test_error_on_directory_to_FileLink():'
77 77 """FileLink: Raises error when passed directory
78 78 """
79 79 td = mkdtemp()
80 nt.assert_raises(ValueError,display.FileLink,td)
80 pytest.raises(ValueError, display.FileLink, td)
81 81
82 82 #--------------------------
83 83 # FileLinks tests
@@ -89,10 +89,10 b' def test_instantiation_FileLinks():'
89 89 fls = display.FileLinks('example')
90 90
91 91 def test_warning_on_non_existent_path_FileLinks():
92 """FileLinks: Calling _repr_html_ on non-existent files returns a warning
93 """
94 fls = display.FileLinks('example')
95 nt.assert_true(fls._repr_html_().startswith('Path (<tt>example</tt>)'))
92 """FileLinks: Calling _repr_html_ on non-existent files returns a warning"""
93 fls = display.FileLinks("example")
94 assert fls._repr_html_().startswith("Path (<tt>example</tt>)")
95
96 96
97 97 def test_existing_path_FileLinks():
98 98 """FileLinks: Calling _repr_html_ functions as expected on existing dir
@@ -172,7 +172,8 b' def test_error_on_file_to_FileLinks():'
172 172 """
173 173 td = mkdtemp()
174 174 tf1 = NamedTemporaryFile(dir=td)
175 nt.assert_raises(ValueError,display.FileLinks,tf1.name)
175 pytest.raises(ValueError, display.FileLinks, tf1.name)
176
176 177
177 178 def test_recursive_FileLinks():
178 179 """FileLinks: Does not recurse when recursive=False
@@ -210,7 +211,7 b' class TestAudioDataWithNumpy(TestCase):'
210 211
211 212 @skipif_not_numpy
212 213 def test_audio_from_numpy_array_without_rate_raises(self):
213 nt.assert_raises(ValueError, display.Audio, get_test_tone())
214 self.assertRaises(ValueError, display.Audio, get_test_tone())
214 215
215 216 @skipif_not_numpy
216 217 def test_audio_data_normalization(self):
@@ -232,10 +233,10 b' class TestAudioDataWithNumpy(TestCase):'
232 233 assert actual_max_value == expected_max_value
233 234
234 235 def test_audio_data_without_normalization_raises_for_invalid_data(self):
235 nt.assert_raises(
236 self.assertRaises(
236 237 ValueError,
237 238 lambda: display.Audio([1.001], rate=44100, normalize=False))
238 nt.assert_raises(
239 self.assertRaises(
239 240 ValueError,
240 241 lambda: display.Audio([-1.001], rate=44100, normalize=False))
241 242
@@ -253,9 +254,8 b' class TestAudioDataWithoutNumpy(TestAudioDataWithNumpy):'
253 254 @skipif_not_numpy
254 255 def test_audio_raises_for_nested_list(self):
255 256 stereo_signal = [list(get_test_tone())] * 2
256 nt.assert_raises(
257 TypeError,
258 lambda: display.Audio(stereo_signal, rate=44100))
257 self.assertRaises(TypeError, lambda: display.Audio(stereo_signal, rate=44100))
258
259 259
260 260 @skipif_not_numpy
261 261 def get_test_tone(scale=1):
General Comments 0
You need to be logged in to leave comments. Login now