[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-12-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I am closing this as fixed since all the PRs were merged. Feel free to reopen this if needed. Thanks @mariocj89 and @vstinner for the review. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-12-01 Thread miss-islington
miss-islington added the comment: New changeset 422c1658b7d34fdc73c5fc895b135862103d1983 by Miss Islington (bot) in branch '3.7': bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302) https://github.com/python/cpython/commit/422c1658b7d34fdc73c5fc895b135862103d1983

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-12-01 Thread miss-islington
miss-islington added the comment: New changeset c0566e0ff6c2dd1a8b814ecd65649605c090527b by Miss Islington (bot) in branch '3.6': bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302) https://github.com/python/cpython/commit/c0566e0ff6c2dd1a8b814ecd65649605c090527b

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

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

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

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

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-12-01 Thread STINNER Victor
STINNER Victor added the comment: New changeset edeca92c84a3b08902ecdfe987cde00c7e617887 by Victor Stinner (Xtreak) in branch 'master': bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302) https://github.com/python/cpython/commit/edeca92c84a3b08902ecdfe987cde00c7e617887

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-11-30 Thread Eli_B
Change by Eli_B : -- pull_requests: +10074 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-11-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +cjw296, mariocj89 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-11-29 Thread Eli_B
Change by Eli_B : -- pull_requests: +10053 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-11-29 Thread Eli_B
Eli_B added the comment: I suggest that after reset_mock(), deleted attributes should be available again. In other words, their deletion is reset. I'm opening a PR to this effect. I reported this issue to testing-cabal's mock repo in May 2016

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-09-24 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Adding Michael for thoughts on the fix and desired behavior. Removing 3.5 since only security fixes are accepted and adding 3.8 which is also affected. Thanks -- nosy: +michael.foord versions: +Python 3.8 -Python 3.5

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-09-14 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +8731 stage: -> patch review ___ Python tracker ___ ___

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-09-14 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Can confirm this behavior on CPython master as well. It seems that when an attribute is deleted then a deleted flag is set for the attribute at https://github.com/python/cpython/blob/73820a60cc3c990abb351540ca27bf7689bce8ac/Lib/unittest/mock.py#L737

[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2017-08-10 Thread Hmvp
New submission from Hmvp: When using a mock and deleting a attribute reset_mock cannot be used anymore since it tries to call reset_mock on the _deleted sentinel value. Reproduction path: ``` from unittest.mock import MagicMock mock = MagicMock() mock.a = 'test' del mock.a mock.reset_mock()