gh-72463: Fix ctypes/test_loading.py so that test_find reports skipped (GH-18312)

This commit is contained in:
Michael Felt 2024-02-29 19:37:31 +01:00 committed by GitHub
parent a81d9509ee
commit 04d1000071
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -59,11 +59,15 @@ class LoaderTest(unittest.TestCase):
self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll)
def test_find(self):
found = False
for name in ("c", "m"):
lib = find_library(name)
if lib:
found = True
cdll.LoadLibrary(lib)
CDLL(lib)
if not found:
self.skipTest("Could not find c and m libraries")
@unittest.skipUnless(os.name == "nt",
'test specific to Windows')