summaryrefslogtreecommitdiff
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index fbaea3aaec..85fac30e30 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -2529,6 +2529,10 @@ class StatefulIncrementalDecoder(codecs.IncrementalDecoder):
streamreader=None, streamwriter=None,
incrementaldecoder=cls)
+# Register the previous decoder for testing.
+# Disabled by default, tests will enable it.
+codecs.register(StatefulIncrementalDecoder.lookupTestDecoder)
+
class StatefulIncrementalDecoderTest(unittest.TestCase):
"""
@@ -2579,9 +2583,6 @@ class TextIOWrapperTest(unittest.TestCase):
self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
os_helper.unlink(os_helper.TESTFN)
- codecs.register(StatefulIncrementalDecoder.lookupTestDecoder)
- self.addCleanup(codecs.unregister,
- StatefulIncrementalDecoder.lookupTestDecoder)
def tearDown(self):
os_helper.unlink(os_helper.TESTFN)