Skip to content

Commit 4fa31bc

Browse files
committed
Skip psycopg3 tests for sqlalchemy < 2.0.0
1 parent 63754a9 commit 4fa31bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/functions/test_database.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
import sqlalchemy as sa
33

44
from sqlalchemy_utils import create_database, database_exists, drop_database
5+
from sqlalchemy_utils.compat import get_sqlalchemy_version
56

67
pymysql = None
78
try:
89
import pymysql # noqa
910
except ImportError:
1011
pass
1112

13+
sqlalchemy_version = get_sqlalchemy_version()
14+
1215

1316
class DatabaseTest:
1417
def test_create_and_drop(self, dsn):
@@ -98,6 +101,7 @@ def dsn(self, postgresql_db_user, postgresql_db_password):
98101
)
99102

100103

104+
@pytest.mark.skipif('sqlalchemy_version < (2, 0, 0)')
101105
class TestDatabasePostgresPsycoPG3(DatabaseTest):
102106

103107
@pytest.fixture

0 commit comments

Comments
 (0)