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

(cherry picked from commit 04d1000071)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-02-29 20:39:00 +01:00 committed by GitHub
parent 010aac7c1a
commit d49fdc8d16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,11 +55,15 @@ def test_load_version(self):
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')