summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_imp.py6
-rw-r--r--Lib/test/test_source_encoding.py19
2 files changed, 10 insertions, 15 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index d44dc6b..35b6afa 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -66,11 +66,7 @@ class ImportTests(unittest.TestCase):
self.test_strings = mod.test_strings
self.test_path = mod.__path__
- def test_import_encoded_module(self):
- for modname, encoding, teststr in self.test_strings:
- mod = importlib.import_module('test.encoded_modules.'
- 'module_' + modname)
- self.assertEqual(teststr, mod.test)
+ # test_import_encoded_module moved to test_source_encoding.py
def test_find_module_encoding(self):
for mod, encoding, _ in self.test_strings:
diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py
index 8d7b573..8e68b4e 100644
--- a/Lib/test/test_source_encoding.py
+++ b/Lib/test/test_source_encoding.py
@@ -1,4 +1,4 @@
-# -*- coding: koi8-r -*-
+# -*- coding: utf-8 -*-
import unittest
from test.support import script_helper, captured_stdout, requires_subprocess
@@ -12,15 +12,14 @@ import tempfile
class MiscSourceEncodingTest(unittest.TestCase):
- def test_pep263(self):
- self.assertEqual(
- "ðÉÔÏÎ".encode("utf-8"),
- b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
- )
- self.assertEqual(
- "\ð".encode("utf-8"),
- b'\\\xd0\x9f'
- )
+ def test_import_encoded_module(self):
+ from test.encoded_modules import test_strings
+ # Make sure we're actually testing something
+ self.assertGreaterEqual(len(test_strings), 1)
+ for modname, encoding, teststr in test_strings:
+ mod = importlib.import_module('test.encoded_modules.'
+ 'module_' + modname)
+ self.assertEqual(teststr, mod.test)
def test_compilestring(self):
# see #1882