Fix `Lib/ctypes/test_loading.py` so that `test_find` reports skipped rather than

passed when no libraries to test are found.
This commit is contained in:
M Felt aka aixtools 2020-02-02 12:19:43 +00:00
parent 78c7183f47
commit e9101e7414
2 changed files with 7 additions and 0 deletions

View File

@ -45,10 +45,14 @@ class LoaderTest(unittest.TestCase):
def test_find(self):
for name in ("c", "m"):
found = False
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')

View File

@ -0,0 +1,3 @@
Fix `Lib/ctypes/test_loading.py` so that `test_find` reports skipped if no shared libraries
are found by `find_library`.
Patch by M. Felt.