mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +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 codecs
|
||||||
import contextlib
|
import contextlib
|
||||||
import copy
|
import copy
|
||||||
|
import importlib
|
||||||
import io
|
import io
|
||||||
import pickle
|
import pickle
|
||||||
import os
|
import os
|
||||||
|
@ -3111,9 +3112,9 @@ class TransformCodecTest(unittest.TestCase):
|
||||||
def test_alias_modules_exist(self):
|
def test_alias_modules_exist(self):
|
||||||
encodings_dir = os.path.dirname(encodings.__file__)
|
encodings_dir = os.path.dirname(encodings.__file__)
|
||||||
for value in encodings.aliases.aliases.values():
|
for value in encodings.aliases.aliases.values():
|
||||||
codec_file = os.path.join(encodings_dir, value + ".py")
|
codec_mod = f"encodings.{value}"
|
||||||
self.assertTrue(os.path.isfile(codec_file),
|
self.assertIsNotNone(importlib.util.find_spec(codec_mod),
|
||||||
"Codec file not found: " + codec_file)
|
f"Codec module not found: {codec_mod}")
|
||||||
|
|
||||||
def test_quopri_stateless(self):
|
def test_quopri_stateless(self):
|
||||||
# Should encode with quotetabs=True
|
# Should encode with quotetabs=True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue