aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index 8d661513d..5dc7a0d2f 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -74,7 +74,10 @@ class CustomMockMixin:
child_mock_type = unittest.mock.MagicMock
def __init__(self, spec: Any = None, **kwargs):
+ name = kwargs.pop('name', None) # `name` has special meaning for Mock classes, so we need to set it manually.
super().__init__(spec=spec, **kwargs)
+ if name:
+ self.name = name
if spec:
self._extract_coroutine_methods_from_spec_instance(spec)