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

Unified Diff: Lib/test/test_itertools.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 10 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_iter.py ('k') | Lib/test/test_json/test_decode.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_itertools.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_itertools.py Fri Feb 07 23:40:05 2014 +0200
@@ -326,7 +326,7 @@
if n == 0 or r <= 1:
self.assertEqual(result, regular_combs) # cases that should be identical
else:
- self.assertTrue(set(result) >= set(regular_combs)) # rest should be supersets of regular combs
+ self.assertGreaterEqual(set(result), set(regular_combs)) # rest should be supersets of regular combs
for c in result:
self.assertEqual(len(c), r) # r-length combinations
@@ -1191,7 +1191,7 @@
# tee pass-through to copyable iterator
a, b = tee('abc')
c, d = tee(a)
- self.assertTrue(a is c)
+ self.assertIs(a, c)
# test tee_new
t1, t2 = tee('abc')
@@ -1199,7 +1199,9 @@
self.assertRaises(TypeError, tnew)
self.assertRaises(TypeError, tnew, 10)
t3 = tnew(t1)
- self.assertTrue(list(t1) == list(t2) == list(t3) == list('abc'))
+ self.assertEqual(list(t1), list('abc'))
+ self.assertEqual(list(t2), list('abc'))
+ self.assertEqual(list(t3), list('abc'))
# test that tee objects are weak referencable
a, b = tee(range(10))
« no previous file with comments | « Lib/test/test_iter.py ('k') | Lib/test/test_json/test_decode.py » ('j') | no next file with comments »

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