diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-06-21 08:11:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-21 08:11:17 (GMT) |
commit | f9bab74d5b34c64cf061e1629ff5f3092a4ca9b3 (patch) | |
tree | 6300c872eefba9992cebe7ec5efccaa8ea0d8347 /Lib/test/test_deque.py | |
parent | 19fcffa92773e008e4f5efb80047420a0cfafeec (diff) | |
download | cpython-f9bab74d5b34c64cf061e1629ff5f3092a4ca9b3.zip cpython-f9bab74d5b34c64cf061e1629ff5f3092a4ca9b3.tar.gz cpython-f9bab74d5b34c64cf061e1629ff5f3092a4ca9b3.tar.bz2 |
bpo-41055: Remove outdated tests for the tp_print slot. (GH-21006)
Diffstat (limited to 'Lib/test/test_deque.py')
-rw-r--r-- | Lib/test/test_deque.py | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py index c0f7138..93cc6ca 100644 --- a/Lib/test/test_deque.py +++ b/Lib/test/test_deque.py @@ -66,28 +66,9 @@ class TestBasic(unittest.TestCase): self.assertEqual(list(d), [7, 8, 9]) d = deque(range(200), maxlen=10) d.append(d) - support.unlink(support.TESTFN) - fo = open(support.TESTFN, "w") - try: - fo.write(str(d)) - fo.close() - fo = open(support.TESTFN, "r") - self.assertEqual(fo.read(), repr(d)) - finally: - fo.close() - support.unlink(support.TESTFN) - + self.assertEqual(repr(d)[-30:], ', 198, 199, [...]], maxlen=10)') d = deque(range(10), maxlen=None) self.assertEqual(repr(d), 'deque([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])') - fo = open(support.TESTFN, "w") - try: - fo.write(str(d)) - fo.close() - fo = open(support.TESTFN, "r") - self.assertEqual(fo.read(), repr(d)) - finally: - fo.close() - support.unlink(support.TESTFN) def test_maxlen_zero(self): it = iter(range(100)) @@ -545,21 +526,7 @@ class TestBasic(unittest.TestCase): e = eval(repr(d)) self.assertEqual(list(d), list(e)) d.append(d) - self.assertIn('...', repr(d)) - - def test_print(self): - d = deque(range(200)) - d.append(d) - try: - support.unlink(support.TESTFN) - fo = open(support.TESTFN, "w") - print(d, file=fo, end='') - fo.close() - fo = open(support.TESTFN, "r") - self.assertEqual(fo.read(), repr(d)) - finally: - fo.close() - support.unlink(support.TESTFN) + self.assertEqual(repr(d)[-20:], '7, 198, 199, [...]])') def test_init(self): self.assertRaises(TypeError, deque, 'abc', 2, 3); |