Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue32299

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:unittest.mock.patch.dict.__enter__ should return the dict
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Allen Li, cheryl.sabella, michael.foord, rbcollins, xtreak
Priority:normalKeywords:patch

Created on2017-12-13 07:08 byAllen Li, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 4834closedVadim Tsander,2017-12-13 09:59
PR 11062mergedmariocj89,2018-12-10 09:18
Messages (4)
msg308188 -(view)Author: Allen Li (Allen Li)Date: 2017-12-13 07:08
mock.patch.dict.__enter__ should return the patched dict/mapping object.Currently it returns nothing (None).This would make setting up fixtures more convenient: with mock.patch.dict(some.thing):   some.thing['foo'] = 'bar' with mock.patch.dict(some.thing) as x:   x['foo'] = 'bar'
msg310489 -(view)Author: Michael Foord (michael.foord)*(Python committer)Date: 2018-01-23 09:35
This seems like a reasonable feature request.
msg343772 -(view)Author: Cheryl Sabella (cheryl.sabella)*(Python committer)Date: 2019-05-28 12:53
New changeset04530812e90e45a37ed84e83505d63db7edc1262 by Cheryl Sabella (Mario Corchero) in branch 'master':bpo-32299: Return patched dict when using patch.dict as a context manager (GH-11062)https://github.com/python/cpython/commit/04530812e90e45a37ed84e83505d63db7edc1262
msg343775 -(view)Author: Cheryl Sabella (cheryl.sabella)*(Python committer)Date: 2019-05-28 12:59
@Allen Li, thank you for the report.  And thank you, @Vadim Tsander for the original pull request and @mariocj89 for reviving this.  Also, thank you @eric.araujo for the review and approval.  This has been merged!
History
DateUserActionArgs
2022-04-11 14:58:55adminsetgithub: 76480
2019-05-28 12:59:19cheryl.sabellasetstatus: open -> closed
resolution: fixed
messages: +msg343775

stage: patch review -> resolved
2019-05-28 12:53:35cheryl.sabellasetnosy: +cheryl.sabella
messages: +msg343772
2019-04-12 23:28:31cheryl.sabellasetnosy: +xtreak

versions: + Python 3.8, - Python 3.7
2018-12-10 09:18:19mariocj89setpull_requests: +pull_request10296
2018-01-23 09:35:32michael.foordsetmessages: +msg310489
2018-01-23 08:09:40berker.peksagsetnosy: +rbcollins,michael.foord

versions: - Python 3.6, Python 3.8
2017-12-13 09:59:16Vadim Tsandersetkeywords: +patch
stage: patch review
pull_requests: +pull_request4726
2017-12-13 07:08:31Allen Lisettype: enhancement
2017-12-13 07:08:20Allen Licreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp