Skip to content

Commit 32e5659

Browse files
Apply suggestion from @ByteFlowing1337
Co-authored-by: ByteFlow <fakeshadow1337@gmail.com>
1 parent 206b82a commit 32e5659

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ def test_avg_std(self):
10771077
msg='%s%r' % (variate.__name__, args))
10781078
def test_binomialvariate_log_zero(self):
10791079
# gh-149222: Variety random() return 0.0 no input Error
1080-
with unittest.mock.patch.object(random.Random, 'random', return_value=0.0):
1080+
with unittest.mock.patch.object(random.Random, 'random', side_effect= [0.0] + [0.5] * 20):
10811081
result = random.binomialvariate(10, 0.5)
10821082
self.assertIsInstance(result, int)
10831083
self.assertIn(result, range(11))

0 commit comments

Comments
 (0)