mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +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
|
@ -213,11 +213,16 @@ class GeneralFloatCases(unittest.TestCase):
|
|||
def test_float_containment(self):
|
||||
floats = (INF, -INF, 0.0, 1.0, NAN)
|
||||
for f in floats:
|
||||
self.assertIn(f, [f])
|
||||
self.assertTrue(f in [f], "'%r' not in []" % f)
|
||||
self.assertIn(f, (f,))
|
||||
self.assertTrue(f in (f,), "'%r' not in ()" % f)
|
||||
self.assertIn(f, {f})
|
||||
self.assertTrue(f in {f}, "'%r' not in set()" % f)
|
||||
self.assertIn(f, {f: None})
|
||||
self.assertTrue(f in {f: None}, "'%r' not in {}" % f)
|
||||
self.assertEqual([f].count(f), 1, "[].count('%r') != 1" % f)
|
||||
self.assertIn(f, floats)
|
||||
self.assertTrue(f in floats, "'%r' not in container" % f)
|
||||
|
||||
for f in floats:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue