Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue35082

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:Mock.__dir__ lists deleted attributes
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: mariocj89, michael.foord
Priority:lowKeywords:patch

Created on2018-10-27 10:45 bymariocj89, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 10148mergedmariocj89,2018-10-27 10:50
PR 13859mergedmiss-islington,2019-06-06 10:39
Messages (1)
msg328647 -(view)Author: Mario Corchero (mariocj89)*(Python triager)Date: 2018-10-27 10:45
Calling dir on unittest.mock.Mock will return deleted attributes.This is a result of the way del is implemented in Mock, which just sets a sentinel in the child mocks, so an AttributeError is raised if the attribute is later accessed.We can just check for such sentinel in the __dir__ method and not return those.
History
DateUserActionArgs
2022-04-11 14:59:07adminsetgithub: 79263
2019-06-06 10:40:30asvetlovsetversions: + Python 3.7
2019-06-06 10:40:24asvetlovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-06-06 10:39:08miss-islingtonsetpull_requests: +pull_request13735
2018-10-27 14:44:34serhiy.storchakasetnosy: +michael.foord
2018-10-27 10:50:57mariocj89setkeywords: +patch
stage: patch review
pull_requests: +pull_request9476
2018-10-27 10:45:10mariocj89create
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp