We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 206b82a commit 32e5659Copy full SHA for 32e5659
1 file changed
Lib/test/test_random.py
@@ -1077,7 +1077,7 @@ def test_avg_std(self):
1077
msg='%s%r' % (variate.__name__, args))
1078
def test_binomialvariate_log_zero(self):
1079
# gh-149222: Variety random() return 0.0 no input Error
1080
- with unittest.mock.patch.object(random.Random, 'random', return_value=0.0):
+ with unittest.mock.patch.object(random.Random, 'random', side_effect= [0.0] + [0.5] * 20):
1081
result = random.binomialvariate(10, 0.5)
1082
self.assertIsInstance(result, int)
1083
self.assertIn(result, range(11))
0 commit comments