summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-24 04:10:49 +1200
committerRobert Collins <rbtcollins@hp.com>2015-07-24 04:10:49 +1200
commitc6fde85c68981565a1177dfc21abaa61549d19c4 (patch)
tree8e6c8152ef346c2e8f2f020ced8247ddeeca184d
parent5869185381eedea4a2a99950c63dbf3981c566ea (diff)
parent70398398959045a1b617059201ed4fa02b4fa0fa (diff)
downloadcpython-git-c6fde85c68981565a1177dfc21abaa61549d19c4.tar.gz
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 f31beea8cc..0f621c844d 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::