gh-116303: Skip test module dependent tests if test modules are unavailable (#117341)

This commit is contained in:
Erlend E. Aasland 2024-04-03 15:11:36 +02:00 committed by GitHub
parent 2ec6bb4111
commit ea94b3b149
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 255 additions and 123 deletions

View file

@ -17,6 +17,7 @@ from test.support.os_helper import (
TESTFN, TESTFN_ASCII, TESTFN_UNICODE, make_bad_fd,
)
from test.support.warnings_helper import check_warnings
from test.support.import_helper import import_module
from collections import UserList
import _io # C implementation of io
@ -597,7 +598,7 @@ class COtherFileTests(OtherFileTests, unittest.TestCase):
@cpython_only
def testInvalidFd_overflow(self):
# Issue 15989
import _testcapi
_testcapi = import_module("_testcapi")
self.assertRaises(TypeError, self.FileIO, _testcapi.INT_MAX + 1)
self.assertRaises(TypeError, self.FileIO, _testcapi.INT_MIN - 1)