mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21151)
Use new test.support helper submodules in tests: * distutils tests * test_buffer * test_compile * test_filecmp * test_fileinput * test_readline * test_smtpnet * test_structmembers * test_tools
This commit is contained in:
parent
700cfa8c90
commit
847f94f47b
20 changed files with 69 additions and 42 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import unittest
|
||||
from test import support
|
||||
from test.support import import_helper
|
||||
from test.support import warnings_helper
|
||||
|
||||
# Skip this test if the _testcapi module isn't available.
|
||||
support.import_module('_testcapi')
|
||||
import_helper.import_module('_testcapi')
|
||||
from _testcapi import _test_structmembersType, \
|
||||
CHAR_MAX, CHAR_MIN, UCHAR_MAX, \
|
||||
SHRT_MAX, SHRT_MIN, USHRT_MAX, \
|
||||
|
|
@ -116,27 +117,27 @@ class ReadWriteTests(unittest.TestCase):
|
|||
class TestWarnings(unittest.TestCase):
|
||||
|
||||
def test_byte_max(self):
|
||||
with support.check_warnings(('', RuntimeWarning)):
|
||||
with warnings_helper.check_warnings(('', RuntimeWarning)):
|
||||
ts.T_BYTE = CHAR_MAX+1
|
||||
|
||||
def test_byte_min(self):
|
||||
with support.check_warnings(('', RuntimeWarning)):
|
||||
with warnings_helper.check_warnings(('', RuntimeWarning)):
|
||||
ts.T_BYTE = CHAR_MIN-1
|
||||
|
||||
def test_ubyte_max(self):
|
||||
with support.check_warnings(('', RuntimeWarning)):
|
||||
with warnings_helper.check_warnings(('', RuntimeWarning)):
|
||||
ts.T_UBYTE = UCHAR_MAX+1
|
||||
|
||||
def test_short_max(self):
|
||||
with support.check_warnings(('', RuntimeWarning)):
|
||||
with warnings_helper.check_warnings(('', RuntimeWarning)):
|
||||
ts.T_SHORT = SHRT_MAX+1
|
||||
|
||||
def test_short_min(self):
|
||||
with support.check_warnings(('', RuntimeWarning)):
|
||||
with warnings_helper.check_warnings(('', RuntimeWarning)):
|
||||
ts.T_SHORT = SHRT_MIN-1
|
||||
|
||||
def test_ushort_max(self):
|
||||
with support.check_warnings(('', RuntimeWarning)):
|
||||
with warnings_helper.check_warnings(('', RuntimeWarning)):
|
||||
ts.T_USHORT = USHRT_MAX+1
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue