Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,15 @@ class Test_django_db_blocker:
def test_block_manually(self, django_db_blocker: DjangoDbBlocker) -> None:
try:
django_db_blocker.block()
with pytest.raises(RuntimeError):
with pytest.raises(RuntimeError, match="^Database access not allowed,"):
Item.objects.exists()
finally:
django_db_blocker.restore()

@pytest.mark.django_db
def test_block_with_block(self, django_db_blocker: DjangoDbBlocker) -> None:
with django_db_blocker.block():
with pytest.raises(RuntimeError):
with pytest.raises(RuntimeError, match="^Database access not allowed,"):
Item.objects.exists()

def test_unblock_manually(self, django_db_blocker: DjangoDbBlocker) -> None:
Expand Down