This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Caris Moses
Recipients Caris Moses, Claudiu.Popa, and, cjw296, iforapsy, kushal.das, mariocj89, michael.foord, xtreak
Date 2019-10-11.20:13:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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): = 0 = 0

    def set_foo(self, value): = value

    def set_bar(self, value): = value

def do_something():
    o = MyObject()
    return 'something unrelated'

class MyObjectTest(TestCase):

    @patch('test_mock.MyObject.set_bar', autospec=True)
    @patch('test_mock.MyObject.set_foo', autospec=True)
    def test_do_something(self, mock_set_foo, mock_set_bar):
        manager = Mock()
        manager.attach_mock(mock_set_foo, 'set_foo_func')
        manager.attach_mock(mock_set_bar, 'set_bar_func')
        assert manager.mock_calls == [call.set_foo_func(3), call.set_bar_func(4)]
Date User Action Args
2019-10-11 20:13:44Caris Mosessetrecipients: + Caris Moses, cjw296, michael.foord, Claudiu.Popa, kushal.das, and, mariocj89, xtreak, iforapsy
2019-10-11 20:13:43Caris Mosessetmessageid: <>
2019-10-11 20:13:43Caris Moseslinkissue21478 messages
2019-10-11 20:13:43Caris Mosescreate