mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Closes #21270 : We now override tuple methods in mock.call objects.
This commit is contained in:
parent
a0f33759fa
commit
a37b958d65
3 changed files with 19 additions and 0 deletions
|
@ -2035,6 +2035,12 @@ class _Call(tuple):
|
|||
return _Call(name=name, parent=self, from_kall=False)
|
||||
|
||||
|
||||
def count(self, *args, **kwargs):
|
||||
return self.__getattr__('count')(*args, **kwargs)
|
||||
|
||||
def index(self, *args, **kwargs):
|
||||
return self.__getattr__('index')(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
if not self.from_kall:
|
||||
name = self.name or 'call'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue