]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-72463: Fix ctypes/test_loading.py so that test_find reports skipped (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 29 Feb 2024 19:48:38 +0000 (20:48 +0100)
committerGitHub <noreply@github.com>
Thu, 29 Feb 2024 19:48:38 +0000 (19:48 +0000)
(cherry picked from commit 04d1000071b5eefd4b1dd69051aacad343da4b21)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
Lib/ctypes/test/test_loading.py

index ea892277c4eae9e3cdb062fb95150f546e0f61c1..d24153e3292d145a251cc25b17f5b36d8dba486c 100644 (file)
@@ -45,11 +45,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')