summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dictviews.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_dictviews.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_dictviews.py')
-rw-r--r--Lib/test/test_dictviews.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py
index 4fee755..4d12647 100644
--- a/Lib/test/test_dictviews.py
+++ b/Lib/test/test_dictviews.py
@@ -24,10 +24,10 @@ class DictSetTest(unittest.TestCase):
self.assertNotEqual(keys, {1, "b"})
self.assertNotEqual(keys, {1})
self.assertNotEqual(keys, 42)
- self.assertTrue(1 in keys)
- self.assertTrue("a" in keys)
- self.assertTrue(10 not in keys)
- self.assertTrue("Z" not in keys)
+ self.assertIn(1, keys)
+ self.assertIn("a", keys)
+ self.assertNotIn(10, keys)
+ self.assertNotIn("Z", keys)
self.assertEqual(d.keys(), d.keys())
e = {1: 11, "a": "def"}
self.assertEqual(d.keys(), e.keys())
@@ -44,13 +44,13 @@ class DictSetTest(unittest.TestCase):
self.assertNotEqual(items, {(1, 10), ("a", "def")})
self.assertNotEqual(items, {(1, 10)})
self.assertNotEqual(items, 42)
- self.assertTrue((1, 10) in items)
- self.assertTrue(("a", "ABC") in items)
- self.assertTrue((1, 11) not in items)
- self.assertTrue(1 not in items)
- self.assertTrue(() not in items)
- self.assertTrue((1,) not in items)
- self.assertTrue((1, 2, 3) not in items)
+ self.assertIn((1, 10), items)
+ self.assertIn(("a", "ABC"), items)
+ self.assertNotIn((1, 11), items)
+ self.assertNotIn(1, items)
+ self.assertNotIn((), items)
+ self.assertNotIn((1,), items)
+ self.assertNotIn((1, 2, 3), items)
self.assertEqual(d.items(), d.items())
e = d.copy()
self.assertEqual(d.items(), e.items())