@@ -53,8 +53,8 @@ def test_divide_match(in_rate, out_rate, dtype):
5353 y_divide = soxr .resample (x , in_rate , out_rate )
5454 y_split = soxr .resample (np .asfortranarray (x ), in_rate , out_rate )
5555
56- assert np .allclose (y_oneshot , y_divide )
57- assert np .allclose (y_oneshot , y_split )
56+ assert np .all (y_oneshot == y_divide )
57+ assert np .all (y_oneshot == y_split )
5858
5959
6060@pytest .mark .parametrize ('in_rate, out_rate' , [(44100 , 32000 ), (32000 , 44100 )])
@@ -67,8 +67,8 @@ def test_length_match(in_rate, out_rate, length):
6767 y_divide = soxr .resample (x [:length ], in_rate , out_rate )
6868 y_split = soxr .resample (np .asfortranarray (x )[:length ], in_rate , out_rate )
6969
70- assert np .allclose (y_oneshot , y_divide )
71- assert np .allclose (y_oneshot , y_split )
70+ assert np .all (y_oneshot == y_divide )
71+ assert np .all (y_oneshot == y_split )
7272
7373
7474@pytest .mark .parametrize ('channels' , [1 , 2 , 3 , 5 , 7 , 24 , 49 ])
@@ -80,8 +80,8 @@ def test_channel_match(channels):
8080 y_divide = soxr .resample (x [:, :channels ], 44100 , 32000 )
8181 y_split = soxr .resample (np .asfortranarray (x )[:, :channels ], 44100 , 32000 )
8282
83- assert np .allclose (y_oneshot , y_divide )
84- assert np .allclose (y_oneshot , y_split )
83+ assert np .all (y_oneshot == y_divide )
84+ assert np .all (y_oneshot == y_split )
8585
8686
8787def stream_resample (x , in_rate , out_rate , chunk_size , dtype ):
@@ -113,7 +113,7 @@ def test_stream_length(in_rate, out_rate, chunk_size, length, dtype):
113113 y_oneshot = soxr ._resample_oneshot (x , in_rate , out_rate )
114114 y_stream = stream_resample (x , in_rate , out_rate , chunk_size , dtype )
115115
116- assert np .allclose (y_oneshot , y_stream )
116+ assert np .all (y_oneshot == y_stream )
117117
118118
119119@pytest .mark .parametrize ('in_rate, out_rate' , [(48000 , 22050 ), (8000 , 48000 )])
@@ -177,9 +177,10 @@ def test_int_sine(in_rate, out_rate, dtype):
177177
178178
179179@pytest .mark .parametrize ('num_task' , [2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 12 , 17 , 32 ])
180- def test_multithread (num_task ):
180+ @pytest .mark .parametrize ('dtype' , ['float32' , np .int16 ])
181+ def test_multithread (num_task , dtype ):
181182 # test multi-thread operation
182- x = np .random .randn (25999 , 2 ).astype (np . float32 )
183+ x = ( np .random .randn (25999 , 2 ) * 5000 ) .astype (dtype )
183184
184185 with ThreadPoolExecutor () as p :
185186 results = p .map (
@@ -188,4 +189,4 @@ def test_multithread(num_task):
188189 )
189190 results = list (results )
190191
191- assert np .allclose (results [- 2 ], results [- 1 ])
192+ assert np .all (results [- 2 ] == results [- 1 ])
0 commit comments