mirror of
https://github.com/python/cpython.git
synced 2025-10-23 01:43:53 +00:00
Issue #21503: Use test_both() consistently in test_importlib.
This commit is contained in:
parent
d50cee2045
commit
3497c0bf95
30 changed files with 526 additions and 428 deletions
|
@ -88,6 +88,7 @@ def test_bom_conflict(self):
|
|||
with self.assertRaises(SyntaxError):
|
||||
self.run_test(source)
|
||||
|
||||
|
||||
class EncodingTestPEP451(EncodingTest):
|
||||
|
||||
def load(self, loader):
|
||||
|
@ -96,8 +97,11 @@ def load(self, loader):
|
|||
loader.exec_module(module)
|
||||
return module
|
||||
|
||||
Frozen_EncodingTestPEP451, Source_EncodingTestPEP451 = util.test_both(
|
||||
EncodingTestPEP451, machinery=machinery)
|
||||
|
||||
(Frozen_EncodingTestPEP451,
|
||||
Source_EncodingTestPEP451
|
||||
) = util.test_both(EncodingTestPEP451, machinery=machinery)
|
||||
|
||||
|
||||
class EncodingTestPEP302(EncodingTest):
|
||||
|
||||
|
@ -106,8 +110,10 @@ def load(self, loader):
|
|||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
return loader.load_module(self.module_name)
|
||||
|
||||
Frozen_EncodingTestPEP302, Source_EncodingTestPEP302 = util.test_both(
|
||||
EncodingTestPEP302, machinery=machinery)
|
||||
|
||||
(Frozen_EncodingTestPEP302,
|
||||
Source_EncodingTestPEP302
|
||||
) = util.test_both(EncodingTestPEP302, machinery=machinery)
|
||||
|
||||
|
||||
class LineEndingTest:
|
||||
|
@ -138,6 +144,7 @@ def test_crlf(self):
|
|||
def test_lf(self):
|
||||
self.run_test(b'\n')
|
||||
|
||||
|
||||
class LineEndingTestPEP451(LineEndingTest):
|
||||
|
||||
def load(self, loader, module_name):
|
||||
|
@ -146,8 +153,11 @@ def load(self, loader, module_name):
|
|||
loader.exec_module(module)
|
||||
return module
|
||||
|
||||
Frozen_LineEndingTestPEP451, Source_LineEndingTestPEP451 = util.test_both(
|
||||
LineEndingTestPEP451, machinery=machinery)
|
||||
|
||||
(Frozen_LineEndingTestPEP451,
|
||||
Source_LineEndingTestPEP451
|
||||
) = util.test_both(LineEndingTestPEP451, machinery=machinery)
|
||||
|
||||
|
||||
class LineEndingTestPEP302(LineEndingTest):
|
||||
|
||||
|
@ -156,8 +166,10 @@ def load(self, loader, module_name):
|
|||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
return loader.load_module(module_name)
|
||||
|
||||
Frozen_LineEndingTestPEP302, Source_LineEndingTestPEP302 = util.test_both(
|
||||
LineEndingTestPEP302, machinery=machinery)
|
||||
|
||||
(Frozen_LineEndingTestPEP302,
|
||||
Source_LineEndingTestPEP302
|
||||
) = util.test_both(LineEndingTestPEP302, machinery=machinery)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue