aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-07-06 20:29:49 +0800
committerGitHub <noreply@github.com>2020-07-06 14:29:49 +0200
commitdeb016224cc506503fb05e821a60158c83918ed4 (patch)
tree21b683e93134e016806477e15df1211567441301 /Lib/test/test_unicode.py
parentb4a9263708cc67c98c4d53b16933f6e5dd07990f (diff)
downloadcpython-deb016224cc506503fb05e821a60158c83918ed4.tar.gz
cpython-deb016224cc506503fb05e821a60158c83918ed4.zip
bpo-40275: Use new test.support helper submodules in tests (GH-21317)
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py12
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')