From b1c9a20f5d8961a5b1555cf68eb38afafb39e1d7 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sun, 25 Oct 2020 06:06:13 +0000 Subject: Revert "bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)" This reverts commit c9f696cb96d1c362d5cad871f61da520572d9b08. --- Lib/test/test_io.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Lib/test/test_io.py') 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) -- cgit v1.2.1