diff options
author | Robert Collins <rbtcollins@hp.com> | 2015-07-23 16:10:27 (GMT) |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2015-07-23 16:10:27 (GMT) |
commit | 70398398959045a1b617059201ed4fa02b4fa0fa (patch) | |
tree | 4b2303eb499d83e3d4e4fe520656f9b767ebd185 | |
parent | 88ba360c88c412c0fe5a75ca50cf11bba08e636b (diff) | |
parent | f79dfe3f250bab3375120e4f30643abac08b652d (diff) | |
download | cpython-70398398959045a1b617059201ed4fa02b4fa0fa.zip cpython-70398398959045a1b617059201ed4fa02b4fa0fa.tar.gz cpython-70398398959045a1b617059201ed4fa02b4fa0fa.tar.bz2 |
Add versionchanged information for mock_open.
-rw-r--r-- | Doc/library/unittest.mock.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index f31beea..0f621c8 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -2043,6 +2043,14 @@ mock_open is insufficient, one of the in-memory filesystem packages on `PyPI <https://pypi.python.org/pypi>`_ can offer a realistic filesystem for testing. + .. versionchanged:: 3.4 + Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. + The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather + than returning it on each call. + + .. versionchanged:: 3.5 + *read_data* is now reset on each call to the *mock*. + Using :func:`open` as a context manager is a great way to ensure your file handles are closed properly and is becoming common:: |