Move error test to the function that needs it. Improve error message. (GH-30008)

This commit is contained in:
Raymond Hettinger 2021-12-09 20:24:50 -06:00 committed by GitHub
parent 50669083fe
commit 3fee7776e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 11 deletions

View file

@ -816,10 +816,6 @@ class MersenneTwister_TestBasicOps(TestBasicOps, unittest.TestCase):
maxsize+1, maxsize=maxsize
)
self.gen._randbelow_without_getrandbits(5640, maxsize=maxsize)
# issue 33203: test that _randbelow returns zero on
# n == 0 also in its getrandbits-independent branch.
x = self.gen._randbelow_without_getrandbits(0, maxsize=maxsize)
self.assertEqual(x, 0)
# This might be going too far to test a single line, but because of our
# noble aim of achieving 100% test coverage we need to write a case in