Skip to content

Commit abfc7f2

Browse files
committed
tests: harden Test_django_db_blocker tests
1 parent 6528bc9 commit abfc7f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: tests/test_fixtures.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -606,15 +606,15 @@ class Test_django_db_blocker:
606606
def test_block_manually(self, django_db_blocker):
607607
try:
608608
django_db_blocker.block()
609-
with pytest.raises(RuntimeError):
609+
with pytest.raises(RuntimeError, match="^Database access not allowed,"):
610610
Item.objects.exists()
611611
finally:
612612
django_db_blocker.restore()
613613

614614
@pytest.mark.django_db
615615
def test_block_with_block(self, django_db_blocker):
616616
with django_db_blocker.block():
617-
with pytest.raises(RuntimeError):
617+
with pytest.raises(RuntimeError, match="^Database access not allowed,"):
618618
Item.objects.exists()
619619

620620
def test_unblock_manually(self, django_db_blocker):

0 commit comments

Comments
 (0)