Issue 36092: unittest.mock's patch.object and patch.dict are not supported on classmethod, propery and staticmethod (original) (raw)

Issue36092

Created on 2019-02-23 06:51 by xtreak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg336372 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-02-23 06:51
While looking into the unittest.mock tests I came across test_patch_descriptor [0] which makes an early return since patch.object and patch.dict are not supported on staticmethod, classmethod and property as noted in the comment. The tests still fail on master. The test was added during initial addition of mock to stdlib (commit 345266aa7e7) and I couldn't find any issues related to this. So I am filing this if someones wants to fix it. [0] https://github.com/python/cpython/blob/175421b58cc97a2555e474f479f30a6c5d2250b0/Lib/unittest/test/testmock/testpatch.py#L667
msg356426 - (view) Author: Jackson Riley (jacksonriley) * Date: 2019-11-12 09:18
Hi Karthikeyan, It seems that test_patch_descriptor has been removed by Chris Withers on 1st of May 2019 under commit adbf178. I would therefore propose that this bug be marked as closed/resolved. Cheers, Jackson
msg356439 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-11-12 11:07
Thanks Jackson for the information. I am fine with closing it as outdated and one can reopen if they need this along with reviving the removed tests in the PR.
msg356445 - (view) Author: Jackson Riley (jacksonriley) * Date: 2019-11-12 11:28
Thanks Karthikeyan!
History
Date User Action Args
2022-04-11 14:59:11 admin set github: 80273
2019-11-12 11:28:07 jacksonriley set messages: +
2019-11-12 11:07:20 xtreak set status: open -> closedresolution: out of datemessages: + stage: resolved
2019-11-12 09🔞56 jacksonriley set nosy: + jacksonrileymessages: +
2019-02-23 13:49:42 remi.lapeyre set nosy: + remi.lapeyre
2019-02-23 06:51:44 xtreak create