Change by Caris Moses :
--
title: Mock.call_args and Mock.call_args_list -> Mock.call_args and
Mock.call_args_list not propagated to parent Mock
___
Python tracker
<https://bugs.python.org/issu
New submission from Caris Moses :
When I use some_mock.attach_mock(...) and make calls, the resulting
some_mock.call_args is None while the some_mock.mock_calls list is not empty.
The code below shows this in Python 3.7.5:
from unittest import TestCase
from unittest.mock import patch, Mock
Caris Moses added the comment:
I believe I have found another bug related to this issue. I can start a new
issue if necessary. When I use some_mock.attach_mock(...) and make calls, the
resulting some_mock.call_args is None while the some_mock.mock_calls list is
not empty.
The code below
Caris Moses added the comment:
I see. Thanks for your help!
--
___
Python tracker
<https://bugs.python.org/issue21478>
___
___
Python-bugs-list mailin
Caris Moses added the comment:
Great, thanks so much. It works with the patch. So will this patch be included
in the next released version of Python?
--
___
Python tracker
<https://bugs.python.org/issue21
Caris Moses added the comment:
I am having some trouble figuring out how to use CPython to get the exact PR
you tested on since I've never used CPython before. However, when I just
install Python 3.7.5RC1 and 3.8.0RC1 from the binaries and run your code I do
get the AttributeError. And when
Caris Moses added the comment:
I tried it with mocked functions instead of methods and got the same result, so
I dug into this a little deeper. It seems as though the issue it how the mocked
functions are called. If I replace the do_something() line with the following
then it works
Caris Moses added the comment:
Hello,
I am still running into this issue. I have tested the following code with
Python 3.7.4, 3.7.5rc1 , and 3.8.0rc1.
from unittest import TestCase
from unittest.mock import patch, Mock, call
class MyObject:
def __init__(self):
self.foo = 0