Skip to content

Commit 00413a4

Browse files
committed
Make sure to skip if sqlite
1 parent 5fc655e commit 00413a4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test_app/tests/lib/utils/test_db.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ def test_migrations_are_complete():
1414
assert migrations_are_complete()
1515

1616

17-
class TestAdvisoryLock:
18-
THREAD_WAIT_TIME = 0.1
19-
17+
class SkipIfSqlite:
2018
@pytest.fixture(autouse=True)
2119
def skip_if_sqlite(self):
2220
if connection.vendor == 'sqlite':
2321
pytest.skip('Advisory lock is not written for sqlite')
2422

23+
24+
class TestAdvisoryLock(SkipIfSqlite):
25+
THREAD_WAIT_TIME = 0.1
26+
2527
@pytest.mark.django_db
2628
def test_get_unclaimed_lock(self):
2729
with advisory_lock('test_get_unclaimed_lock'):
@@ -62,7 +64,7 @@ def test_invalid_tuple_name(self):
6264
# Special transaction=True parameter is used, because we do not want in normal test transactions
6365
# because dropping the connection would break the transaction context, erroring at end of test
6466
@pytest.mark.django_db(transaction=True)
65-
class TestAdvisoryLockPostgresErrors:
67+
class TestAdvisoryLockPostgresErrors(SkipIfSqlite):
6668
"""Tests related to connection management and the advisory_lock"""
6769

6870
def kick_connection(self):

0 commit comments

Comments
 (0)