Allow libpq tests to fail

They fail on image build when we delete the system library.
This commit is contained in:
Daniele Varrazzo 2021-05-23 23:26:48 +02:00
parent ec531bee31
commit 367ea40b1e

View File

@ -178,7 +178,10 @@ class ConnectingTestCase(unittest.TestCase):
if libname is None and platform.system() == 'Windows':
raise self.skipTest("can't import libpq on windows")
rv = ConnectingTestCase._libpq = ctypes.pydll.LoadLibrary(libname)
try:
rv = ConnectingTestCase._libpq = ctypes.pydll.LoadLibrary(libname)
except OSError as e:
raise self.skipTest("couldn't open libpq for testing: %s" % e)
return rv