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, 3 insertions, 4 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 85fac30e30..fbaea3aaec 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -2529,10 +2529,6 @@ 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):
"""
@@ -2583,6 +2579,9 @@ 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)