Skip to content

Commit 39cebae

Browse files
committed
Fix documented default of read_data in unittest.mock.mock_open
The documented signature showed read_data=None, but the actual default is the empty string -- Lib/unittest/mock.py, the function's docstring, and inspect.signature all agree. The code default changed from None to '' in 2012 (0dccf65); the docs were never updated.
1 parent 5b38519 commit 39cebae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ Alternatively you can just use ``vars(my_mock)`` (instance members) and
25392539
mock_open
25402540
~~~~~~~~~
25412541

2542-
.. function:: mock_open(mock=None, read_data=None)
2542+
.. function:: mock_open(mock=None, read_data='')
25432543

25442544
A helper function to create a mock to replace the use of :func:`open`. It works
25452545
for :func:`open` called directly or used as a context manager.

0 commit comments

Comments
 (0)