mirror of
https://github.com/python/cpython.git
synced 2025-09-25 17:59:57 +00:00
Add versionchanged information for mock_open.
This commit is contained in:
commit
c6fde85c68
1 changed files with 8 additions and 0 deletions
|
@ -2043,6 +2043,14 @@ mock_open
|
||||||
is insufficient, one of the in-memory filesystem packages on `PyPI
|
is insufficient, one of the in-memory filesystem packages on `PyPI
|
||||||
<https://pypi.python.org/pypi>`_ can offer a realistic filesystem for testing.
|
<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
|
Using :func:`open` as a context manager is a great way to ensure your file handles
|
||||||
are closed properly and is becoming common::
|
are closed properly and is becoming common::
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue