mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
use assert[Not]In where appropriate
A patch from Dave Malcolm.
This commit is contained in:
parent
a69ba65fdc
commit
577473fe68
75 changed files with 471 additions and 454 deletions
|
@ -211,7 +211,7 @@ class SystemRandom_TestBasicOps(TestBasicOps):
|
|||
|
||||
n += n - 1 # check 1 below the next power of two
|
||||
k = int(1.00001 + _log(n, 2))
|
||||
self.assertTrue(k in [numbits, numbits+1])
|
||||
self.assertIn(k, [numbits, numbits+1])
|
||||
self.assertTrue(2**k > n > 2**(k-2))
|
||||
|
||||
n -= n >> 15 # check a little farther below the next power of two
|
||||
|
@ -367,7 +367,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
|
|||
|
||||
n += n - 1 # check 1 below the next power of two
|
||||
k = int(1.00001 + _log(n, 2))
|
||||
self.assertTrue(k in [numbits, numbits+1])
|
||||
self.assertIn(k, [numbits, numbits+1])
|
||||
self.assertTrue(2**k > n > 2**(k-2))
|
||||
|
||||
n -= n >> 15 # check a little farther below the next power of two
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue