From 69648bd2886cc3be4f8e68e98c7ad10669d98123 Mon Sep 17 00:00:00 2001 From: Fran Sy Date: Wed, 29 Nov 2023 08:34:18 +0800 Subject: [PATCH] fix tests --- test/test_base.py | 2 ++ tox.ini | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_base.py b/test/test_base.py index 21c7e21..68bde8e 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -31,6 +31,7 @@ def db_config(): "OPTIONS": {}, "AUTOCOMMIT": True, "CONN_MAX_AGE": None, + "CONN_HEALTH_CHECKS": False, "TIME_ZONE": None, } @@ -102,6 +103,7 @@ def test_DatabaseWrapper_validate_connection_handles_closed_connections( **db_config, "OPTIONS": {"VALIDATE_CONNECTION": True, "VALIDATION_INTERVAL": 0}, "CONN_MAX_AGE": 0, # this will make close_if_unusable_or_obsolete close the connection + "CONN_HEALTH_CHECKS": False, }) db.connect() db.validate_connection() diff --git a/tox.ini b/tox.ini index bb50606..ef6faf6 100644 --- a/tox.ini +++ b/tox.ini @@ -9,13 +9,13 @@ deps = pytest-django pytest-mock freezegun - pyodbc + pyodbc<5 dj3: Django>=3.2.0,<4 dj4: Django>=4,<5 commands = - pytest -v \ + pytest -v -x \ --cov-report term-missing \ --cov-fail-under '70' \ --no-cov-on-fail \