Message329823
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/testwith.py", line 177, in test_explicit_mock
mock.assert_called_once_with('foo')
File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 838, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 823, in assert_called_with
if expected != actual:
File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 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:26 | xtreak | set | recipients:
+ xtreak, cjw296, michael.foord, mariocj89 |
2018-11-13 10:26:26 | xtreak | set | messageid: <1542104786.73.0.788709270274.issue35226@psf.upfronthosting.co.za> |
2018-11-13 10:26:26 | xtreak | link | issue35226 messages |
2018-11-13 10:26:26 | xtreak | create | |
|