Skip to content

Commit c6531b7

Browse files
committed
add test for negative rt error
1 parent 7a2e37f commit c6531b7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/test_5_parametric.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
def test_rtanalysis_parameteric(meanRT, sdRT, meanAcc):
1818
test_df = generate_test_df(meanRT, sdRT, meanAcc)
1919
rta = RTAnalysis()
20-
if meanAcc > 0:
20+
if min(test_df.rt) <= 0:
21+
# make sure it catches the rt < 0 error
22+
with pytest.raises(ValueError):
23+
rta.fit(test_df.rt, test_df.accuracy)
24+
elif meanAcc > 0:
2125
rta.fit(test_df.rt, test_df.accuracy)
2226
assert np.allclose(meanRT, rta.mean_rt_)
2327
assert np.allclose(meanAcc, rta.mean_accuracy_)
2428
else:
29+
# make sure it catches the zero accuracy error
2530
with pytest.raises(ValueError):
2631
rta.fit(test_df.rt, test_df.accuracy)

0 commit comments

Comments
 (0)