@@ -339,7 +339,7 @@ def test_constructor(self):
339339
340340 @pytest .mark .asyncio
341341 async def test__pre_commit_success (self ):
342- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
342+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
343343 wrapped = self ._make_one (to_wrap )
344344
345345 txn_id = b"totes-began"
@@ -368,7 +368,7 @@ async def test__pre_commit_success(self):
368368 async def test__pre_commit_retry_id_already_set_success (self ):
369369 from google .cloud .firestore_v1 .types import common
370370
371- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
371+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
372372 wrapped = self ._make_one (to_wrap )
373373 txn_id1 = b"already-set"
374374 wrapped .retry_id = txn_id1
@@ -401,7 +401,7 @@ async def test__pre_commit_retry_id_already_set_success(self):
401401 @pytest .mark .asyncio
402402 async def test__pre_commit_failure (self ):
403403 exc = RuntimeError ("Nope not today." )
404- to_wrap = mock . Mock (side_effect = exc , spec = [])
404+ to_wrap = AsyncMock (side_effect = exc , spec = [])
405405 wrapped = self ._make_one (to_wrap )
406406
407407 txn_id = b"gotta-fail"
@@ -438,7 +438,7 @@ async def test__pre_commit_failure_with_rollback_failure(self):
438438 from google .api_core import exceptions
439439
440440 exc1 = ValueError ("I will not be only failure." )
441- to_wrap = mock . Mock (side_effect = exc1 , spec = [])
441+ to_wrap = AsyncMock (side_effect = exc1 , spec = [])
442442 wrapped = self ._make_one (to_wrap )
443443
444444 txn_id = b"both-will-fail"
@@ -614,7 +614,7 @@ async def test__maybe_commit_failure_cannot_retry(self):
614614
615615 @pytest .mark .asyncio
616616 async def test___call__success_first_attempt (self ):
617- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
617+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
618618 wrapped = self ._make_one (to_wrap )
619619
620620 txn_id = b"whole-enchilada"
@@ -650,7 +650,7 @@ async def test___call__success_second_attempt(self):
650650 from google .cloud .firestore_v1 .types import firestore
651651 from google .cloud .firestore_v1 .types import write
652652
653- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
653+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
654654 wrapped = self ._make_one (to_wrap )
655655
656656 txn_id = b"whole-enchilada"
@@ -707,7 +707,7 @@ async def test___call__failure(self):
707707 _EXCEED_ATTEMPTS_TEMPLATE ,
708708 )
709709
710- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
710+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
711711 wrapped = self ._make_one (to_wrap )
712712
713713 txn_id = b"only-one-shot"
0 commit comments