1
+ from typing import Any
2
+ from typing import Dict
3
+
1
4
import asyncio
2
5
import functools
3
6
import inspect
4
7
5
8
import pytest
6
9
7
- from ._version import version
8
-
9
- __version__ = version
10
-
11
10
12
11
def _get_mock_module (config ):
13
12
"""
@@ -209,7 +208,7 @@ def _mocker(pytestconfig):
209
208
210
209
211
210
_mock_module_patches = []
212
- _mock_module_originals = {}
211
+ _mock_module_originals = {} # type: Dict[str, Any]
213
212
214
213
215
214
def assert_wrapper (__wrapped_mock_method__ , * args , ** kwargs ):
@@ -228,18 +227,17 @@ def assert_wrapper(__wrapped_mock_method__, *args, **kwargs):
228
227
introspection = ""
229
228
try :
230
229
assert actual_args == args [1 :]
231
- except AssertionError as e :
232
- introspection += "\n Args:\n " + str (e )
230
+ except AssertionError as e_args :
231
+ introspection += "\n Args:\n " + str (e_args )
233
232
try :
234
233
assert actual_kwargs == kwargs
235
- except AssertionError as e :
236
- introspection += "\n Kwargs:\n " + str (e )
237
-
234
+ except AssertionError as e_kwargs :
235
+ introspection += "\n Kwargs:\n " + str (e_kwargs )
238
236
if introspection :
239
237
msg += "\n \n pytest introspection follows:\n " + introspection
240
- e = AssertionError (msg )
241
- e ._mock_introspection_applied = True
242
- raise e
238
+ e = AssertionError (msg )
239
+ e ._mock_introspection_applied = True
240
+ raise e
243
241
244
242
245
243
def wrap_assert_not_called (* args , ** kwargs ):
0 commit comments