classification
Title: Document builtins in mock_open
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, jcrotts
Priority: normal Keywords: patch

Created on 2018-05-31 18:35 by jcrotts, last changed 2018-06-07 19:13 by jcrotts.

Pull Requests
URL Status Linked Edit
PR 7491 open jcrotts, 2018-06-07 19:13
Messages (1)
msg318337 - (view) Author: Jay Crotts (jcrotts) * Date: 2018-05-31 18:35
The examples on using mock_open only include instances where objects are mocked in the REPL, so '__main__'.open is replaced. Commonly objects are mocked for use in other test modules, so builtins.open would be used instead.

A note about this in the documentation would be useful not familiar with python internals. I'm happy to do a PR for it.
History
Date User Action Args
2018-06-07 19:13:50jcrottssetkeywords: + patch
stage: patch review
pull_requests: + pull_request7116
2018-05-31 18:35:34jcrottscreate