Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

Unified Diff: Lib/test/test_collections.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_codeop.py ('k') | Lib/test/test_compile.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_collections.py Tue Jan 15 11:08:30 2013 +0200
+++ b/Lib/test/test_collections.py Tue Jan 15 12:53:12 2013 +0200
@@ -637,7 +637,7 @@
def __hash__(self):
return self._hash()
a, b = OneTwoThreeSet(), OneTwoThreeSet()
- self.assertTrue(hash(a) == hash(b))
+ self.assertEqual(hash(a), hash(b))
def test_MutableSet(self):
self.assertIsInstance(set(), MutableSet)
@@ -930,7 +930,7 @@
Counter(words),
]):
msg = (i, dup, words)
- self.assertTrue(dup is not words)
+ self.assertIsNot(dup, words)
self.assertEqual(dup, words)
self.assertEqual(len(dup), len(words))
self.assertEqual(type(dup), type(words))
@@ -955,7 +955,7 @@
def test_invariant_for_the_in_operator(self):
c = Counter(a=10, b=-2, c=0)
for elem in c:
- self.assertTrue(elem in c)
+ self.assertIn(elem, c)
self.assertIn(elem, c)
def test_multiset_operations(self):
@@ -1225,7 +1225,7 @@
update_test,
OrderedDict(od),
]):
- self.assertTrue(dup is not od)
+ self.assertIsNot(dup, od)
self.assertEqual(dup, od)
self.assertEqual(list(dup.items()), list(od.items()))
self.assertEqual(len(dup), len(od))
« no previous file with comments | « Lib/test/test_codeop.py ('k') | Lib/test/test_compile.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+