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

Unified Diff: Lib/test/test_bigmem.py

Issue 20547: Use specific asserts in bigmem tests
Patch Set: Created 2 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
index 6133bbc..d532ff5 100644
--- a/Lib/test/test_bigmem.py
+++ b/Lib/test/test_bigmem.py
@@ -865,7 +865,7 @@ def test_hash(self, size):
h1 = hash(t1)
del t1
t2 = (0,) * (size + 1)
- self.assertFalse(h1 == hash(t2))
+ self.assertNotEqual(h1, hash(t2))
@bigmemtest(size=_2G + 10, memuse=8)
def test_index_and_slice(self, size):
@@ -991,8 +991,8 @@ def basic_test_inplace_concat(self, size):
l = [sys.stdout] * size
l += l
self.assertEqual(len(l), size * 2)
- self.assertTrue(l[0] is l[-1])
- self.assertTrue(l[size - 1] is l[size + 1])
+ self.assertIs(l[0], l[-1])
+ self.assertIs(l[size - 1], l[size + 1])
@bigmemtest(size=_2G // 2 + 2, memuse=24)
def test_inplace_concat_small(self, size):
@@ -1091,13 +1091,13 @@ def basic_test_inplace_repeat(self, size):
l = ['']
l *= size
self.assertEqual(len(l), size)
- self.assertTrue(l[0] is l[-1])
+ self.assertIs(l[0], l[-1])
del l
l = [''] * size
l *= 2
self.assertEqual(len(l), size * 2)
- self.assertTrue(l[size - 1] is l[-1])
+ self.assertIs(l[size - 1], l[-1])
@bigmemtest(size=_2G // 2 + 2, memuse=16)
def test_inplace_repeat_small(self, size):
@@ -1131,8 +1131,8 @@ def test_append(self, size):
l = [object()] * size
l.append(object())
self.assertEqual(len(l), size+1)
- self.assertTrue(l[-3] is l[-2])
- self.assertFalse(l[-2] is l[-1])
+ self.assertIs(l[-3], l[-2])
+ self.assertIsNot(l[-2], l[-1])
@bigmemtest(size=_2G // 5 + 2, memuse=8 * 5)
def test_count(self, size):
@@ -1144,8 +1144,8 @@ def basic_test_extend(self, size):
l = [object] * size
l.extend(l)
self.assertEqual(len(l), size * 2)
- self.assertTrue(l[0] is l[-1])
- self.assertTrue(l[size - 1] is l[size + 1])
+ self.assertIs(l[0], l[-1])
+ self.assertIs(l[size - 1], l[size + 1])
@bigmemtest(size=_2G // 2 + 2, memuse=16)
def test_extend_small(self, size):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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