[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-04 Thread Chris Withers
Chris Withers added the comment: New changeset 70ca3fce9fe2bdd7bf97d5fe1299cfa5e32b3ad4 by Chris Withers (Miss Islington (bot)) in branch '3.6': bpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy. (GH-10873)

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-04 Thread Chris Withers
Chris Withers added the comment: New changeset 12735c14134082584b899308af8dd8fcc9f15696 by Chris Withers (Miss Islington (bot)) in branch '3.7': bpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy. (GH-10873) (#10887)

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-04 Thread Chris Withers
Change by Chris Withers : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-04 Thread miss-islington
Change by miss-islington : -- pull_requests: +10126 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-04 Thread miss-islington
Change by miss-islington : -- pull_requests: +10125 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-04 Thread Chris Withers
Chris Withers added the comment: New changeset e63e617ebbe481c498bdf037a62e09f4f9f3963f by Chris Withers (Andrew Dunai) in branch 'master': bpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy. (#10873)

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-03 Thread Andrew Dunai
Change by Andrew Dunai : -- keywords: +patch pull_requests: +10110 stage: -> patch review ___ Python tracker ___ ___

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-03 Thread Andrew Dunai
Andrew Dunai added the comment: I was considering wrapping a `unittest.mock._Call` class definition within a function that would contain name & parent as local variables (arguments). Thus they would be accessible within the `_Call` class, but wouldn't be accessible from the outside. However

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-03 Thread Andrew Dunai
Andrew Dunai added the comment: I see 2 most applicable ways to do it: - Hide .parent and .name by mangling - Define them within the mock class definition scope, but not within the class itself. As long as those are accessed only from within the mock class, I think second method would be

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-03 Thread Chris Withers
Chris Withers added the comment: Not sure I follow the second option, I was thinking of just _mock_parent and _mock_name when I logged this. Happy to see a PR for either though! -- ___ Python tracker

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-03 Thread Chris Withers
Chris Withers added the comment: Go for it! :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-12-03 Thread Andrew Dunai
Andrew Dunai added the comment: I've just stumbled upon this issue while looking for a good first issue to contribute on. If the community agrees this is something that needs to be done, I'll gladly work on this. -- nosy: +and3rson ___ Python

[issue35357] unittest.mock.call can't represent calls to a method called 'parent'

2018-11-29 Thread Chris Withers
New submission from Chris Withers : While working on https://bugs.python.org/issue35226, I stumbled upon this: >>> from unittest.mock import call >>> call.parent() Traceback (most recent call last): File "", line 1, in TypeError: 'NoneType' object is not callable Guess we need to make