summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-23 16:09:59 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-23 16:09:59 (GMT)
commitf79dfe3f250bab3375120e4f30643abac08b652d (patch)
tree5b884faf291f475b0fb73f10e904d5610a11b7b4
parentca647ef60aa74e3dea81a399ded20c648a69e742 (diff)
downloadcpython-f79dfe3f250bab3375120e4f30643abac08b652d.zip
cpython-f79dfe3f250bab3375120e4f30643abac08b652d.tar.gz
cpython-f79dfe3f250bab3375120e4f30643abac08b652d.tar.bz2
Add versionchanged information for mock_open.
-rw-r--r--Doc/library/unittest.mock.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index fcd7727..13b3133 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -2001,6 +2001,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.4.4
+ *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::