[issue21750] mock_open data is visible only once for the life of the class

Paul Koning report at bugs.python.org
Wed Jul 22 17:04:59 CEST 2015


Paul Koning added the comment:

Section 26.7.7 of the library manual describes mock_open with the words:

A helper function to create a mock to replace the use of open. It works for open called directly or used as a context manager.

which implies that it works just like open.  Given that it doesn't (not if you do two opens and use both streams concurrently) that difference should be called out as a difference, or limitation.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21750>
_______________________________________


More information about the Python-bugs-list mailing list