[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2017-10-23 Thread Ron Rothman
Ron Rothman added the comment: Confirmed that the behavior exists in Python 3.6 as well. -- versions: +Python 3.6 ___ Python tracker <https://bugs.python.org/issue31

[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2017-10-23 Thread Ron Rothman
New submission from Ron Rothman : mock.mock_open works as expected when reading the entire file (read()) or when reading a single line (readline()), but it seems to not support reading a number of bytes (read(n)). These work as expected: from mock import mock_open, patch # works