18
18
19
19
from .helpers import DjangoPytester
20
20
21
+ from pytest_django import DjangoDbBlocker
21
22
from pytest_django_test .app .models import Item
22
23
23
24
@@ -690,7 +691,7 @@ class Migration(migrations.Migration):
690
691
691
692
class Test_django_db_blocker :
692
693
@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 :
694
695
try :
695
696
django_db_blocker .block ()
696
697
with pytest .raises (RuntimeError ):
@@ -699,19 +700,19 @@ def test_block_manually(self, django_db_blocker) -> None:
699
700
django_db_blocker .restore ()
700
701
701
702
@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 :
703
704
with django_db_blocker .block ():
704
705
with pytest .raises (RuntimeError ):
705
706
Item .objects .exists ()
706
707
707
- def test_unblock_manually (self , django_db_blocker ) -> None :
708
+ def test_unblock_manually (self , django_db_blocker : DjangoDbBlocker ) -> None :
708
709
try :
709
710
django_db_blocker .unblock ()
710
711
Item .objects .exists ()
711
712
finally :
712
713
django_db_blocker .restore ()
713
714
714
- def test_unblock_with_block (self , django_db_blocker ) -> None :
715
+ def test_unblock_with_block (self , django_db_blocker : DjangoDbBlocker ) -> None :
715
716
with django_db_blocker .unblock ():
716
717
Item .objects .exists ()
717
718
0 commit comments