mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
use assert[Not]In where appropriate
This commit is contained in:
parent
8cd0a66a0f
commit
aa98058cc4
86 changed files with 622 additions and 599 deletions
|
|
@ -289,7 +289,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
|
||||
|
|
@ -445,7 +445,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