diff options
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 59697935fe5..afc95555db0 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -15,6 +15,8 @@ import textwrap import unicodedata import unittest import warnings +from test.support import import_helper +from test.support import warnings_helper from test import support, string_tests from test.support.script_helper import assert_python_failure @@ -504,7 +506,7 @@ class UnicodeTest(string_tests.CommonTest, self.assertIs(text.replace(pattern, pattern), text) def test_bytes_comparison(self): - with support.check_warnings(): + with warnings_helper.check_warnings(): warnings.simplefilter('ignore', BytesWarning) self.assertEqual('abc' == b'abc', False) self.assertEqual('abc' != b'abc', True) @@ -725,7 +727,7 @@ class UnicodeTest(string_tests.CommonTest, import _testcapi u = '𝖀𝖓𝖎𝖈𝖔𝖉𝖊' self.assertTrue(u.isidentifier()) - with support.check_warnings(): + with warnings_helper.check_warnings(): warnings.simplefilter('ignore', DeprecationWarning) self.assertTrue(_testcapi.unicode_legacy_string(u).isidentifier()) @@ -2507,7 +2509,7 @@ class CAPITest(unittest.TestCase): # Test PyUnicode_FromFormat() def test_from_format(self): - support.import_module('ctypes') + import_helper.import_module('ctypes') from ctypes import ( pythonapi, py_object, sizeof, c_int, c_long, c_longlong, c_ssize_t, @@ -2748,7 +2750,7 @@ class CAPITest(unittest.TestCase): @support.cpython_only def test_aswidechar(self): from _testcapi import unicode_aswidechar - support.import_module('ctypes') + import_helper.import_module('ctypes') from ctypes import c_wchar, sizeof wchar, size = unicode_aswidechar('abcdef', 2) @@ -2786,7 +2788,7 @@ class CAPITest(unittest.TestCase): @support.cpython_only def test_aswidecharstring(self): from _testcapi import unicode_aswidecharstring - support.import_module('ctypes') + import_helper.import_module('ctypes') from ctypes import c_wchar, sizeof wchar, size = unicode_aswidecharstring('abc') |