diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2019-03-18 19:49:16 +0000 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2019-03-18 19:49:16 +0000 |
| commit | 953bc66ca66fd8bbc18086bba9218072a9dfb8e7 (patch) | |
| tree | 118e6f2211e87b41a1832572e9226aef1f2efdfa /tests/test_cursor.py | |
| parent | 5b4caadd236caf8c5afb68eba5e258569e3817c4 (diff) | |
| download | psycopg2-953bc66ca66fd8bbc18086bba9218072a9dfb8e7.tar.gz | |
Allow tests to be ignored if dynamic binding failed2_8_BETA_2
Diffstat (limited to 'tests/test_cursor.py')
| -rwxr-xr-x | tests/test_cursor.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 47b41e6..ce1b0cb 100755 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -654,14 +654,18 @@ class CursorTests(ConnectingTestCase): curs = self.conn.cursor() self.assert_(curs.pgresult_ptr is None) - f = self.libpq.PQcmdStatus - f.argtypes = [ctypes.c_void_p] - f.restype = ctypes.c_char_p - curs.execute("select 'x'") self.assert_(curs.pgresult_ptr is not None) - status = f(curs.pgresult_ptr) - self.assertEqual(status, b'SELECT 1') + + try: + f = self.libpq.PQcmdStatus + except AttributeError: + pass + else: + f.argtypes = [ctypes.c_void_p] + f.restype = ctypes.c_char_p + status = f(curs.pgresult_ptr) + self.assertEqual(status, b'SELECT 1') curs.close() self.assert_(curs.pgresult_ptr is None) |
