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 xtreak
Recipients cjw296, mariocj89, michael.foord, xtreak
Date 2018-11-13.10:26:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Yes, for call objects it's always there but some of the tests use a tuple during self.assertEquals and hence during equality check other fails with the attribute error for parent like below. Also getattr(self, 'parent', None) != getattr(other, 'parent', None) will skip the attribute error but still fail for tuples in tests I guess with tuple.parent returned as None and checked against a valid parent. Hence the patch with both the checks of getattr and self.parent that passes the test suite. I will wait for input from maintainers if my approach is correct since I am little new to mock :)

ERROR: test_explicit_mock (unittest.test.testmock.testwith.TestMockOpen)
Traceback (most recent call last):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/test/testmock/", line 177, in test_explicit_mock
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/", line 838, in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/", line 823, in assert_called_with
    if expected != actual:
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/", line 2057, in __eq__
    if self.parent != other.parent:
AttributeError: 'tuple' object has no attribute 'parent'
Date User Action Args
2018-11-13 10:26:26xtreaksetrecipients: + xtreak, cjw296, michael.foord, mariocj89
2018-11-13 10:26:26xtreaksetmessageid: <>
2018-11-13 10:26:26xtreaklinkissue35226 messages
2018-11-13 10:26:26xtreakcreate