--- a/Lib/test/pickletester.py Fri Feb 07 17:53:13 2014 +0100 |
+++ b/Lib/test/pickletester.py Fri Feb 07 23:40:05 2014 +0200 |
@@ -645,7 +645,7 @@ |
x = self.loads(s) |
self.assertIsInstance(x, list) |
self.assertEqual(len(x), 1) |
- self.assertTrue(x is x[0]) |
+ self.assertIs(x, x[0]) |
def test_recursive_tuple(self): |
t = ([],) |
@@ -656,7 +656,7 @@ |
self.assertIsInstance(x, tuple) |
self.assertEqual(len(x), 1) |
self.assertEqual(len(x[0]), 1) |
- self.assertTrue(x is x[0][0]) |
+ self.assertIs(x, x[0][0]) |
def test_recursive_dict(self): |
d = {} |
@@ -666,7 +666,7 @@ |
x = self.loads(s) |
self.assertIsInstance(x, dict) |
self.assertEqual(list(x.keys()), [1]) |
- self.assertTrue(x[1] is x) |
+ self.assertIs(x[1], x) |
def test_recursive_set(self): |
h = H() |
@@ -713,7 +713,7 @@ |
self.assertEqual(len(x), 1) |
self.assertEqual(dir(x[0]), dir(i)) |
self.assertEqual(list(x[0].attr.keys()), [1]) |
- self.assertTrue(x[0].attr[1] is x) |
+ self.assertIs(x[0].attr[1], x) |
def test_get(self): |
self.assertRaises(KeyError, self.loads, b'g0\np0') |
@@ -982,9 +982,9 @@ |
for x in None, False, True: |
s = self.dumps(x, proto) |
y = self.loads(s) |
- self.assertTrue(x is y, (proto, x, s, y)) |
+ self.assertIs(x, y, (proto, x, s, y)) |
expected = expected_opcode[min(proto, 3), x] |
- self.assertTrue(opcode_in_pickle(expected, s)) |
+ self.assertEqual(opcode_in_pickle(expected, s), True) |
def test_newobj_tuple(self): |
x = MyTuple([1, 2, 3]) |
@@ -1102,7 +1102,7 @@ |
if proto == 0: |
self.assertEqual(num_appends, 0) |
else: |
- self.assertTrue(num_appends >= 2) |
+ self.assertGreaterEqual(num_appends, 2) |
def test_dict_chunking(self): |
n = 10 # too small to chunk |
@@ -1125,7 +1125,7 @@ |
if proto == 0: |
self.assertEqual(num_setitems, 0) |
else: |
- self.assertTrue(num_setitems >= 2) |
+ self.assertGreaterEqual(num_setitems, 2) |
def test_set_chunking(self): |
n = 10 # too small to chunk |
@@ -2068,7 +2068,7 @@ |
primed.memo.clear() |
self.assertEqual(unpickled_data2, data) |
- self.assertTrue(unpickled_data2 is unpickled_data1) |
+ self.assertIs(unpickled_data2, unpickled_data1) |
def test_reusing_unpickler_objects(self): |
data1 = ["abcdefg", "abcdefg", 44] |