mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21772)
This commit is contained in:
parent
e27a51c11e
commit
fcce8c649a
8 changed files with 27 additions and 18 deletions
|
@ -17,6 +17,7 @@ import unittest
|
|||
|
||||
import test.support
|
||||
from test.support import import_helper
|
||||
from test.support import warnings_helper
|
||||
import test.string_tests
|
||||
import test.list_tests
|
||||
from test.support import bigaddrspacetest, MAX_Py_ssize_t
|
||||
|
@ -27,7 +28,7 @@ if sys.flags.bytes_warning:
|
|||
def check_bytes_warnings(func):
|
||||
@functools.wraps(func)
|
||||
def wrapper(*args, **kw):
|
||||
with test.support.check_warnings(('', BytesWarning)):
|
||||
with warnings_helper.check_warnings(('', BytesWarning)):
|
||||
return func(*args, **kw)
|
||||
return wrapper
|
||||
else:
|
||||
|
@ -1769,7 +1770,7 @@ class AssortedBytesTest(unittest.TestCase):
|
|||
"BytesWarning is needed for this test: use -bb option")
|
||||
def test_compare(self):
|
||||
def bytes_warning():
|
||||
return test.support.check_warnings(('', BytesWarning))
|
||||
return warnings_helper.check_warnings(('', BytesWarning))
|
||||
with bytes_warning():
|
||||
b'' == ''
|
||||
with bytes_warning():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue