Skip to content

Commit

Permalink
chore(internal): skip unsupported sqlite transaction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed Aug 4, 2024
1 parent 22a0830 commit f163218
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion databases/sync_tests/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_timeout(client: Prisma) -> None:
raise exc.value


@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='This is currently broken...')
@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='SQLite does not support concurrent writes')
def test_concurrent_transactions(client: Prisma) -> None:
"""Two separate transactions can be used independently of each other at the same time"""
timeout = timedelta(milliseconds=15000)
Expand Down Expand Up @@ -144,6 +144,7 @@ def test_transaction_raises_original_error(client: Prisma) -> None:
raise RuntimeError('Test error!')


@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='SQLite does not support concurrent writes')
def test_transaction_within_transaction_warning(client: Prisma) -> None:
"""A warning is raised if a transaction is started from another transaction client"""
tx1 = client.tx().start()
Expand All @@ -160,6 +161,7 @@ def test_transaction_within_transaction_warning(client: Prisma) -> None:
assert record.filename == __file__


@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='SQLite does not support concurrent writes')
def test_transaction_within_transaction_context_warning(
client: Prisma,
) -> None:
Expand Down
4 changes: 3 additions & 1 deletion databases/tests/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def test_timeout(client: Prisma) -> None:


@pytest.mark.asyncio
@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='This is currently broken...')
@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='SQLite does not support concurrent writes')
async def test_concurrent_transactions(client: Prisma) -> None:
"""Two separate transactions can be used independently of each other at the same time"""
timeout = timedelta(milliseconds=15000)
Expand Down Expand Up @@ -152,6 +152,7 @@ async def test_transaction_raises_original_error(client: Prisma) -> None:


@pytest.mark.asyncio
@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='SQLite does not support concurrent writes')
async def test_transaction_within_transaction_warning(client: Prisma) -> None:
"""A warning is raised if a transaction is started from another transaction client"""
tx1 = await client.tx().start()
Expand All @@ -169,6 +170,7 @@ async def test_transaction_within_transaction_warning(client: Prisma) -> None:


@pytest.mark.asyncio
@pytest.mark.skipif(CURRENT_DATABASE == 'sqlite', reason='SQLite does not support concurrent writes')
async def test_transaction_within_transaction_context_warning(
client: Prisma,
) -> None:
Expand Down

0 comments on commit f163218

Please sign in to comment.