summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-01-19 00:09:57 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-01-19 00:09:57 (GMT)
commit577473fe687b38c8f01b0c372d6d2563680045b3 (patch)
treeee7dc210c7c5281cf07add09a9cb451758e91716 /Lib/test/test_float.py
parenta69ba65fdce3be6f55634b47cc56cf1f962f6cbc (diff)
downloadcpython-577473fe687b38c8f01b0c372d6d2563680045b3.zip
cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.gz
cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.bz2
use assert[Not]In where appropriate
A patch from Dave Malcolm.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index fd0f410..db397ce 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -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: