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 278c11b commit e7233dcCopy full SHA for e7233dc
1 file changed
Lib/test/test_random.py
@@ -1076,9 +1076,9 @@ def test_avg_std(self):
1076
self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2,
1077
msg='%s%r' % (variate.__name__, args))
1078
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()
+ def test_binomialvariate_log_zero(self):
+ # gh-149222: Variety random() return 0.0 no input Error
+ with unittest.mock.patch.object(random.Random, 'random', return_value=0.0):
1082
result = random.binomialvariate(10, 0.5)
1083
self.assertIsInstance(result, int)
1084
self.assertIn(result, range(11))
0 commit comments