@@ -339,7 +339,7 @@ def test_constructor(self):
339
339
340
340
@pytest .mark .asyncio
341
341
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 = [])
343
343
wrapped = self ._make_one (to_wrap )
344
344
345
345
txn_id = b"totes-began"
@@ -368,7 +368,7 @@ async def test__pre_commit_success(self):
368
368
async def test__pre_commit_retry_id_already_set_success (self ):
369
369
from google .cloud .firestore_v1 .types import common
370
370
371
- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
371
+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
372
372
wrapped = self ._make_one (to_wrap )
373
373
txn_id1 = b"already-set"
374
374
wrapped .retry_id = txn_id1
@@ -401,7 +401,7 @@ async def test__pre_commit_retry_id_already_set_success(self):
401
401
@pytest .mark .asyncio
402
402
async def test__pre_commit_failure (self ):
403
403
exc = RuntimeError ("Nope not today." )
404
- to_wrap = mock . Mock (side_effect = exc , spec = [])
404
+ to_wrap = AsyncMock (side_effect = exc , spec = [])
405
405
wrapped = self ._make_one (to_wrap )
406
406
407
407
txn_id = b"gotta-fail"
@@ -438,7 +438,7 @@ async def test__pre_commit_failure_with_rollback_failure(self):
438
438
from google .api_core import exceptions
439
439
440
440
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 = [])
442
442
wrapped = self ._make_one (to_wrap )
443
443
444
444
txn_id = b"both-will-fail"
@@ -614,7 +614,7 @@ async def test__maybe_commit_failure_cannot_retry(self):
614
614
615
615
@pytest .mark .asyncio
616
616
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 = [])
618
618
wrapped = self ._make_one (to_wrap )
619
619
620
620
txn_id = b"whole-enchilada"
@@ -650,7 +650,7 @@ async def test___call__success_second_attempt(self):
650
650
from google .cloud .firestore_v1 .types import firestore
651
651
from google .cloud .firestore_v1 .types import write
652
652
653
- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
653
+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
654
654
wrapped = self ._make_one (to_wrap )
655
655
656
656
txn_id = b"whole-enchilada"
@@ -707,7 +707,7 @@ async def test___call__failure(self):
707
707
_EXCEED_ATTEMPTS_TEMPLATE ,
708
708
)
709
709
710
- to_wrap = mock . Mock (return_value = mock .sentinel .result , spec = [])
710
+ to_wrap = AsyncMock (return_value = mock .sentinel .result , spec = [])
711
711
wrapped = self ._make_one (to_wrap )
712
712
713
713
txn_id = b"only-one-shot"
0 commit comments