mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)
* Move the codecs' (un)register operation to testcases. * Remove _codecs._forget_codec() and _PyCodec_Forget()
This commit is contained in:
parent
cf693e537d
commit
c9f696cb96
7 changed files with 16 additions and 112 deletions
|
@ -36,7 +36,6 @@ def search_function(encoding):
|
|||
return (encode2, decode2, None, None)
|
||||
else:
|
||||
return None
|
||||
codecs.register(search_function)
|
||||
|
||||
def duplicate_string(text):
|
||||
"""
|
||||
|
@ -58,6 +57,10 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
|
||||
type2test = str
|
||||
|
||||
def setUp(self):
|
||||
codecs.register(search_function)
|
||||
self.addCleanup(codecs.unregister, search_function)
|
||||
|
||||
def checkequalnofix(self, result, object, methodname, *args):
|
||||
method = getattr(object, methodname)
|
||||
realresult = method(*args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue