summaryrefslogtreecommitdiff
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-10-25 06:06:13 +0000
committerGitHub <noreply@github.com>2020-10-25 06:06:13 +0000
commitb1c9a20f5d8961a5b1555cf68eb38afafb39e1d7 (patch)
treee5c3a1f5cddec8c49c94647d300a7ca2e76f191a /Lib/test/test_io.py
parent4a9c6379380defd37b5483607d0d804db18f7812 (diff)
downloadcpython-git-revert-22513-update_test_codecs.tar.gz
Revert "bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)"revert-22513-update_test_codecs
This reverts commit c9f696cb96d1c362d5cad871f61da520572d9b08.
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)