]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127647: Fix and enable I/O protocol tests (#138369)
authorSebastian Rittau <srittau@rittau.biz>
Tue, 2 Sep 2025 13:45:29 +0000 (15:45 +0200)
committerGitHub <noreply@github.com>
Tue, 2 Sep 2025 13:45:29 +0000 (06:45 -0700)
Lib/test/test_io/test_general.py

index a56a2c0157f76439c05db3fea4f7e438b1b50eb4..e3d7d26a7e0f9c46df530fdd7a0718d569275a7a 100644 (file)
@@ -5029,12 +5029,12 @@ class ProtocolsTest(unittest.TestCase):
             pass
 
     def test_reader_subclass(self):
-        self.assertIsSubclass(MyReader, io.Reader[bytes])
-        self.assertNotIsSubclass(str, io.Reader[bytes])
+        self.assertIsSubclass(self.MyReader, io.Reader)
+        self.assertNotIsSubclass(str, io.Reader)
 
     def test_writer_subclass(self):
-        self.assertIsSubclass(MyWriter, io.Writer[bytes])
-        self.assertNotIsSubclass(str, io.Writer[bytes])
+        self.assertIsSubclass(self.MyWriter, io.Writer)
+        self.assertNotIsSubclass(str, io.Writer)
 
 
 def load_tests(loader, tests, pattern):
@@ -5048,6 +5048,7 @@ def load_tests(loader, tests, pattern):
              CTextIOWrapperTest, PyTextIOWrapperTest,
              CMiscIOTest, PyMiscIOTest,
              CSignalsTest, PySignalsTest, TestIOCTypes,
+             ProtocolsTest,
              )
 
     # Put the namespaces of the IO module we are testing and some useful mock