Skip to content

Commit e7233dc

Browse files
authored
Change test
1 parent 278c11b commit e7233dc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_random.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,9 @@ def test_avg_std(self):
10761076
self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2,
10771077
msg='%s%r' % (variate.__name__, args))
10781078

1079-
@unittest.mock.patch.object(random.Random, 'random', return_value=0.0)
1080-
def test_binomialvariate_log_zero(self, mock_random):
1081-
# Test for gh-149222: binomialvariate should not crash when random()
1079+
def test_binomialvariate_log_zero(self):
1080+
# gh-149222: Variety random() return 0.0 no input Error
1081+
with unittest.mock.patch.object(random.Random, 'random', return_value=0.0):
10821082
result = random.binomialvariate(10, 0.5)
10831083
self.assertIsInstance(result, int)
10841084
self.assertIn(result, range(11))

0 commit comments

Comments
 (0)