Skip to content

Commit

Permalink
relaxing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Dec 18, 2017
1 parent ce4bbe5 commit a7be961
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/util/test_rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def test_round_midpoint(self):
self.assertEquals(random_state.round_midpoint(3.6), 4)

avg = 3.5
samples = 1000
samples = 2000
obs_avg = np.mean([random_state.round_midpoint(avg) for i in range(samples)])
min = np.floor(avg) + binom.ppf(0.001, n=samples, p=avg % 1) / samples
max = np.floor(avg) + binom.ppf(0.999, n=samples, p=avg % 1) / samples
self.assertGreater(obs_avg, min)
self.assertLess(obs_avg, max)
min = np.floor(avg) + binom.ppf(0.0001, n=samples, p=avg % 1) / samples
max = np.floor(avg) + binom.ppf(0.9999, n=samples, p=avg % 1) / samples
self.assertGreaterEqual(obs_avg, min)
self.assertLessEqual(obs_avg, max)

def test_round_poisson(self):
random_state = RandomState()
Expand Down

0 comments on commit a7be961

Please sign in to comment.