Skip to content

Commit 017bd77

Browse files
committed
tests: type django_db_blocker fixtures
This also serves as a typing test.
1 parent d599fdb commit 017bd77

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_fixtures.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from .helpers import DjangoPytester
2020

21+
from pytest_django import DjangoDbBlocker
2122
from pytest_django_test.app.models import Item
2223

2324

@@ -690,7 +691,7 @@ class Migration(migrations.Migration):
690691

691692
class Test_django_db_blocker:
692693
@pytest.mark.django_db
693-
def test_block_manually(self, django_db_blocker) -> None:
694+
def test_block_manually(self, django_db_blocker: DjangoDbBlocker) -> None:
694695
try:
695696
django_db_blocker.block()
696697
with pytest.raises(RuntimeError):
@@ -699,19 +700,19 @@ def test_block_manually(self, django_db_blocker) -> None:
699700
django_db_blocker.restore()
700701

701702
@pytest.mark.django_db
702-
def test_block_with_block(self, django_db_blocker) -> None:
703+
def test_block_with_block(self, django_db_blocker: DjangoDbBlocker) -> None:
703704
with django_db_blocker.block():
704705
with pytest.raises(RuntimeError):
705706
Item.objects.exists()
706707

707-
def test_unblock_manually(self, django_db_blocker) -> None:
708+
def test_unblock_manually(self, django_db_blocker: DjangoDbBlocker) -> None:
708709
try:
709710
django_db_blocker.unblock()
710711
Item.objects.exists()
711712
finally:
712713
django_db_blocker.restore()
713714

714-
def test_unblock_with_block(self, django_db_blocker) -> None:
715+
def test_unblock_with_block(self, django_db_blocker: DjangoDbBlocker) -> None:
715716
with django_db_blocker.unblock():
716717
Item.objects.exists()
717718

0 commit comments

Comments
 (0)