]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] 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:39:00 +0000 (20:39 +0100)
committerGitHub <noreply@github.com>
Thu, 29 Feb 2024 19:39:00 +0000 (19:39 +0000)
(cherry picked from commit 04d1000071b5eefd4b1dd69051aacad343da4b21)

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

index f2434926a51714ba69307a0a04cb66f577c58790..0ecd2b41869e35319816ceeb043cc401a7eb43c6 100644 (file)
@@ -55,11 +55,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')