Skip to content

Commit

Permalink
Fix expected histogram in random interval test
Browse files Browse the repository at this point in the history
  • Loading branch information
niboshi committed Jun 20, 2017
1 parent c8f4ba3 commit 88dff08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/cupy_tests/random_tests/test_generator.py
Expand Up @@ -242,15 +242,15 @@ def test_goodness_of_fit(self):
vals = [self.rs.interval(mx, None).get()
for _ in six.moves.xrange(trial)]
counts = numpy.histogram(vals, bins=numpy.arange(mx + 2))[0]
expected = numpy.array([float(trial) / mx + 1] * (mx + 1))
expected = numpy.array([float(trial) / (mx + 1)] * (mx + 1))
self.assertTrue(hypothesis.chi_square_test(counts, expected))

@condition.retry(5)
def test_goodness_of_fit_2(self):
mx = 5
vals = self.rs.interval(mx, (5, 5)).get()
counts = numpy.histogram(vals, bins=numpy.arange(mx + 2))[0]
expected = numpy.array([float(vals.size) / mx + 1] * (mx + 1))
expected = numpy.array([float(vals.size) / (mx + 1)] * (mx + 1))
self.assertTrue(hypothesis.chi_square_test(counts, expected))


Expand Down

0 comments on commit 88dff08

Please sign in to comment.