mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[3.14] gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (GH-134777) (GH-134781)
gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (GH-134777)
(cherry picked from commit 8704d6b391
)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
This commit is contained in:
parent
58549cfd49
commit
266b541cc6
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
import codecs
|
||||
import contextlib
|
||||
import copy
|
||||
import importlib
|
||||
import io
|
||||
import pickle
|
||||
import os
|
||||
|
@ -3111,9 +3112,9 @@ class TransformCodecTest(unittest.TestCase):
|
|||
def test_alias_modules_exist(self):
|
||||
encodings_dir = os.path.dirname(encodings.__file__)
|
||||
for value in encodings.aliases.aliases.values():
|
||||
codec_file = os.path.join(encodings_dir, value + ".py")
|
||||
self.assertTrue(os.path.isfile(codec_file),
|
||||
"Codec file not found: " + codec_file)
|
||||
codec_mod = f"encodings.{value}"
|
||||
self.assertIsNotNone(importlib.util.find_spec(codec_mod),
|
||||
f"Codec module not found: {codec_mod}")
|
||||
|
||||
def test_quopri_stateless(self):
|
||||
# Should encode with quotetabs=True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue