22# @Author: gviejo
33# @Date: 2022-03-30 11:16:30
44# @Last Modified by: Guillaume Viejo
5- # @Last Modified time: 2024-01-26 15:09:42
5+ # @Last Modified time: 2024-01-26 15:23:20
66
77"""Tests of tuning curves for `pynapple` package."""
88
@@ -36,7 +36,7 @@ def test_compute_discrete_tuning_curves_with_strings():
3636def test_compute_discrete_tuning_curves_error ():
3737 dict_ep = { "0" :nap .IntervalSet (start = 0 , end = 50 ),
3838 "1" :nap .IntervalSet (start = 50 , end = 100 )}
39- with pytest .raises (RuntimeError ) as e_info :
39+ with pytest .raises (AssertionError ) as e_info :
4040 nap .compute_discrete_tuning_curves ([1 ,2 ,3 ], dict_ep )
4141 assert str (e_info .value ) == "group should be a TsGroup."
4242
@@ -45,9 +45,9 @@ def test_compute_discrete_tuning_curves_error():
4545 "1" :nap .IntervalSet (start = 50 , end = 100 )}
4646 k = [1 ,2 ,3 ]
4747 dict_ep ["2" ] = k
48- with pytest .raises (RuntimeError ) as e_info :
48+ with pytest .raises (AssertionError ) as e_info :
4949 nap .compute_discrete_tuning_curves (tsgroup , dict_ep )
50- assert str (e_info .value ) == "dict_ep argument should contain only IntervalSet. \n Key 2 in dict_ep is not an IntervalSet"
50+ assert str (e_info .value ) == "dict_ep argument should contain only IntervalSet. Key 2 in dict_ep is not an IntervalSet"
5151
5252def test_compute_1d_tuning_curves ():
5353 tsgroup = nap .TsGroup ({0 : nap .Ts (t = np .arange (0 , 100 ))})
@@ -61,7 +61,7 @@ def test_compute_1d_tuning_curves():
6161
6262def test_compute_1d_tuning_curves_error ():
6363 feature = nap .Tsd (t = np .arange (0 , 100 , 0.1 ), d = np .arange (0 , 100 , 0.1 ) % 1.0 )
64- with pytest .raises (RuntimeError ) as e_info :
64+ with pytest .raises (AssertionError ) as e_info :
6565 nap .compute_1d_tuning_curves ([1 ,2 ,3 ], feature , nb_bins = 10 )
6666 assert str (e_info .value ) == "group should be a TsGroup."
6767
@@ -110,15 +110,15 @@ def test_compute_2d_tuning_curves_error():
110110 (np .repeat (np .arange (0 , 100 ), 10 ), np .tile (np .arange (0 , 100 ), 10 ))
111111 ).T
112112 features = nap .TsdFrame (t = np .arange (0 , 200 , 0.1 ), d = np .vstack ((tmp , tmp [::- 1 ])))
113- with pytest .raises (RuntimeError ) as e_info :
113+ with pytest .raises (AssertionError ) as e_info :
114114 nap .compute_2d_tuning_curves ([1 ,2 ,3 ], features , 10 )
115115 assert str (e_info .value ) == "group should be a TsGroup."
116116
117117 tsgroup = nap .TsGroup (
118118 {0 : nap .Ts (t = np .arange (0 , 100 , 10 )), 1 : nap .Ts (t = np .array ([50 , 149 ]))}
119119 )
120120 features = nap .TsdFrame (t = np .arange (100 ), d = np .random .rand (100 , 3 ))
121- with pytest .raises (RuntimeError ) as e_info :
121+ with pytest .raises (AssertionError ) as e_info :
122122 nap .compute_2d_tuning_curves (tsgroup , features , 10 )
123123 assert str (e_info .value ) == "feature should have 2 columns only."
124124
0 commit comments