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

Robert Collins report at bugs.python.org
Wed Jul 15 02:23:36 CEST 2015


Robert Collins added the comment:

I think its worth noting that both the original mock_open and the new one are entirely broken for mocking access to multiple files.

But, the breakage was not deliberate, and as the mock-280 example shows, folk subclassing a test suite will be surprisingly broken vs the long table releases of mock itself.

So, I think its ok to fix this - relying on the second file appearing empty is IMO unlikely, and being more compatible with the prior releases of mock is good.

We probably need to rethink this interface and provide a better one though, so that you can mock a filesystem easily. Thats a different discussion though.

----------

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


More information about the Python-bugs-list mailing list