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

@ -117,7 +117,9 @@ class TestFcntl(unittest.TestCase):
@cpython_only
def test_fcntl_bad_file_overflow(self):
from _testcapi import INT_MAX, INT_MIN
_testcapi = import_module("_testcapi")
INT_MAX = _testcapi.INT_MAX
INT_MIN = _testcapi.INT_MIN
# Issue 15989
with self.assertRaises(OverflowError):
fcntl.fcntl(INT_MAX + 1, fcntl.F_SETFL, os.O_NONBLOCK)
@ -189,7 +191,7 @@ class TestFcntl(unittest.TestCase):
@cpython_only
def test_flock_overflow(self):
import _testcapi
_testcapi = import_module("_testcapi")
self.assertRaises(OverflowError, fcntl.flock, _testcapi.INT_MAX+1,
fcntl.LOCK_SH)