Skip to content

Commit

Permalink
fix assertRaises, that was actually not testing anything
Browse files Browse the repository at this point in the history
The function did in fact return None, but the assertRaises was wrongly
written, so it did not test that the function raises anything.
  • Loading branch information
PetrDlouhy committed May 11, 2022
1 parent 677d60d commit cb19fb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experiments/tests/test_significance.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def test_equal(self):
self.assertChiSquareCorrect(((100, 100, 100), (200, 200, 200), (300, 300, 300)), 0, 1)

def test_error(self):
self.assertRaises(TypeError, chi_square_p_value((1,)))
self.assertRaises(TypeError, chi_square_p_value(((1,2,3))))
self.assertEqual(chi_square_p_value((1,)), None)
self.assertEqual(chi_square_p_value(((0,2,3))), None)

def test_is_none(self):
self.assertEqual(chi_square_p_value(((1, 1), (1, -1))), (None, None), "Negative numbers should not be allowed")
Expand Down

0 comments on commit cb19fb8

Please sign in to comment.