summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-05-23 23:26:48 +0200
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-05-26 17:23:40 +0100
commit367ea40b1e39dd6333610383e57df2d8badfd2b9 (patch)
tree624401803782cd583a9e8453acecdc7b13e9fdf4
parentec531bee31556ae1a1e42ced364d97b56a493a5d (diff)
downloadpsycopg2-367ea40b1e39dd6333610383e57df2d8badfd2b9.tar.gz
Allow libpq tests to fail
They fail on image build when we delete the system library.
-rw-r--r--tests/testutils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index f0c3264..3f8ceb3 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -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