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

Unified Diff: Lib/test/test_richcmp.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_re.py ('k') | Lib/test/test_sax.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_richcmp.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_richcmp.py Fri Feb 07 23:40:05 2014 +0200
@@ -106,7 +106,7 @@
self.assertEqual(len(realres), len(expres))
for i in range(len(realres)):
# results are bool, so we can use "is" here
- self.assertTrue(realres[i] is expres[i])
+ self.assertIs(realres[i], expres[i])
def test_mixed(self):
# check that comparisons involving Vector objects
@@ -163,7 +163,7 @@
for op in opmap[opname]:
realres = op(ta, tb)
realres = getattr(realres, "x", realres)
- self.assertTrue(realres is expres)
+ self.assertIs(realres, expres)
def test_values(self):
# check all operators and all comparison results
@@ -238,7 +238,7 @@
b.append(17)
# Even recursive lists of different lengths are different,
# but they cannot be ordered
- self.assertTrue(not (a == b))
+ self.assertFalse(a == b)
self.assertTrue(a != b)
self.assertRaises(RuntimeError, operator.lt, a, b)
self.assertRaises(RuntimeError, operator.le, a, b)
@@ -249,7 +249,7 @@
self.assertRaises(RuntimeError, operator.ne, a, b)
a.insert(0, 11)
b.insert(0, 12)
- self.assertTrue(not (a == b))
+ self.assertFalse(a == b)
self.assertTrue(a != b)
self.assertTrue(a < b)
« no previous file with comments | « Lib/test/test_re.py ('k') | Lib/test/test_sax.py » ('j') | no next file with comments »

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