|
11 | 11 | from itertools import cycle, count |
12 | 12 | from test import support |
13 | 13 | from test.support import check_sanitizer, os_helper, threading_helper |
14 | | -from .utils import byteslike, CTestCase, PyTestCase |
| 14 | +from .utils import byteslike, CTestCase |
15 | 15 |
|
16 | 16 |
|
17 | 17 | import io # C implementation. |
18 | | -import _pyio as pyio # Python implementation. |
19 | 18 |
|
20 | 19 |
|
21 | 20 | class CommonBufferedTests: |
@@ -595,13 +594,10 @@ def test_initialization(self): |
595 | 594 | def test_misbehaved_io_read(self): |
596 | 595 | rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg")) |
597 | 596 | bufio = self.tp(rawio) |
598 | | - # _pyio.BufferedReader seems to implement reading different, so that |
599 | | - # checking this is not so easy. |
600 | 597 | self.assertRaises(OSError, bufio.read, 10) |
601 | 598 |
|
602 | 599 | def test_garbage_collection(self): |
603 | 600 | # C BufferedReader objects are collected. |
604 | | - # The Python version has __del__, so it ends into gc.garbage instead |
605 | 601 | self.addCleanup(os_helper.unlink, os_helper.TESTFN) |
606 | 602 | # Note that using warnings_helper.check_warnings() will keep the |
607 | 603 | # file alive due to the `source` argument to warn(). So, use |
@@ -657,10 +653,6 @@ def test_read1_error_does_not_cause_reentrant_failure(self): |
657 | 653 | self.assertEqual(bufio.read1(1), b"h") |
658 | 654 |
|
659 | 655 |
|
660 | | -class PyBufferedReaderTest(BufferedReaderTest, PyTestCase): |
661 | | - tp = pyio.BufferedReader |
662 | | - |
663 | | - |
664 | 656 | class BufferedWriterTest(CommonBufferedTests): |
665 | 657 | write_mode = "wb" |
666 | 658 |
|
@@ -972,7 +964,6 @@ def test_initialization(self): |
972 | 964 | def test_garbage_collection(self): |
973 | 965 | # C BufferedWriter objects are collected, and collecting them flushes |
974 | 966 | # all data to disk. |
975 | | - # The Python version has __del__, so it ends into gc.garbage instead |
976 | 967 | self.addCleanup(os_helper.unlink, os_helper.TESTFN) |
977 | 968 | # Note that using warnings_helper.check_warnings() will keep the |
978 | 969 | # file alive due to the `source` argument to warn(). So, use |
@@ -1017,9 +1008,6 @@ def closed(self): |
1017 | 1008 | self.assertRaisesRegex(ValueError, "test", bufio.close) |
1018 | 1009 |
|
1019 | 1010 |
|
1020 | | -class PyBufferedWriterTest(BufferedWriterTest, PyTestCase): |
1021 | | - tp = pyio.BufferedWriter |
1022 | | - |
1023 | 1011 | class BufferedRWPairTest: |
1024 | 1012 |
|
1025 | 1013 | def test_constructor(self): |
@@ -1273,9 +1261,6 @@ def test_weakref_clearing(self): |
1273 | 1261 | class CBufferedRWPairTest(BufferedRWPairTest, CTestCase): |
1274 | 1262 | tp = io.BufferedRWPair |
1275 | 1263 |
|
1276 | | -class PyBufferedRWPairTest(BufferedRWPairTest, PyTestCase): |
1277 | | - tp = pyio.BufferedRWPair |
1278 | | - |
1279 | 1264 |
|
1280 | 1265 | class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest): |
1281 | 1266 | read_mode = "rb+" |
@@ -1570,10 +1555,6 @@ def flush(): |
1570 | 1555 | self.assertFalse(rawio.closed) |
1571 | 1556 |
|
1572 | 1557 |
|
1573 | | -class PyBufferedRandomTest(BufferedRandomTest, PyTestCase): |
1574 | | - tp = pyio.BufferedRandom |
1575 | | - |
1576 | | - |
1577 | 1558 | # Simple test to ensure that optimizations in the IO library deliver the |
1578 | 1559 | # expected results. For best testing, run this under a debug-build Python too |
1579 | 1560 | # (to exercise asserts in the C code). |
@@ -1635,9 +1616,6 @@ def test_nullpat(self): |
1635 | 1616 | class CBufferSizeTest(BufferSizeTest, unittest.TestCase): |
1636 | 1617 | open = io.open |
1637 | 1618 |
|
1638 | | -class PyBufferSizeTest(BufferSizeTest, unittest.TestCase): |
1639 | | - open = staticmethod(pyio.open) |
1640 | | - |
1641 | 1619 |
|
1642 | 1620 | if __name__ == "__main__": |
1643 | 1621 | unittest.main() |
0 commit comments