Issue 35022: MagicMock should support __fspath__ (original) (raw)

Issue35022

Created on 2018-10-19 00:29 by Maxime Belanger, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9960 merged maxbelanger,2018-10-19 01:01
Messages (4)
msg328014 - (view) Author: Maxime Belanger (Maxime Belanger) Date: 2018-10-19 00:29
We have plenty of tests calling into `os.path.*` functions, and as Python 3.6+ gets more stringent about checking for `os.PathLike` compliance, it would greatly simplify our lives for `MagicMock` to support `__fspath__`.
msg328498 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-25 21:49
New changeset 6c83d9f4a72905d968418bef670bb3091d2744db by Victor Stinner (Max Bélanger) in branch 'master': bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960) https://github.com/python/cpython/commit/6c83d9f4a72905d968418bef670bb3091d2744db
msg328499 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-25 21:51
Thanks Maxime Belanger for your contribution! Thanks Mario Corchero for the review. Oh, you added Python 3.7 to this issue, but sadly we don't add new features to minor Python versions (like Python 3.7.2) :-( Otherwise, it would mean that depending on the minor version, you may or may get the feature... You will have to workaround MagicMock limitation until Python 3.8 is released.
msg344793 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-06-06 08:39
Closing this as resolved since this is merged for 3.8. Thank you all.
History
Date User Action Args
2022-04-11 14:59:07 admin set github: 79203
2019-06-06 08:39:46 xtreak set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2018-10-25 21:51:31 vstinner set messages: + versions: - Python 3.7
2018-10-25 21:49:03 vstinner set nosy: + vstinnermessages: +
2018-10-19 02:41:36 ned.deily set nosy: + michael.foord
2018-10-19 01:50:07 xtreak set nosy: + xtreak
2018-10-19 01:01:22 maxbelanger set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest9307>
2018-10-19 00:29:51 Maxime Belanger create