]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: allow importing the tests module on master with Psycopg 3.1
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 19 Nov 2023 12:36:16 +0000 (13:36 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 19 Nov 2023 12:36:16 +0000 (13:36 +0100)
Useful to test the master version of the pool with a released version of
psycopg.

tests/_test_connection.py

index d8282293425a3557387c16d0b8b4706f60112f85..fefa86a25315978f135382c8e3eaf263ca5226eb 100644 (file)
@@ -8,9 +8,12 @@ from dataclasses import dataclass
 import pytest
 import psycopg
 from psycopg.conninfo import conninfo_to_dict
-from psycopg._connection_base import BaseConnection
 
-DEFAULT_TIMEOUT = BaseConnection._DEFAULT_CONNECT_TIMEOUT
+# Don't import this to allow tests to import (not necessarily to pass all)
+# if the psycopg module imported is not the one expected (e.g. running
+# psycopg pool tests on the master branch with psycopg 3.1.x imported).
+# psycopg._connection_base.BaseConnection._DEFAULT_CONNECT_TIMEOUT
+DEFAULT_TIMEOUT = 130
 
 
 @pytest.fixture