@@ -1825,12 +1825,12 @@ sentinel
1825
1825
1826
1826
.. data :: sentinel
1827
1827
1828
- The ``sentinel `` object provides a convenient way of providing unique
1829
- objects for your tests.
1828
+ The ``sentinel `` object provides a convenient way of providing unique
1829
+ objects for your tests.
1830
1830
1831
- Attributes are created on demand when you access them by name. Accessing
1832
- the same attribute will always return the same object. The objects
1833
- returned have a sensible repr so that test failure messages are readable.
1831
+ Attributes are created on demand when you access them by name. Accessing
1832
+ the same attribute will always return the same object. The objects
1833
+ returned have a sensible repr so that test failure messages are readable.
1834
1834
1835
1835
.. versionchanged :: 3.7
1836
1836
The ``sentinel `` attributes now preserve their identity when they are
@@ -2070,22 +2070,22 @@ mock_open
2070
2070
2071
2071
.. function :: mock_open(mock=None, read_data=None)
2072
2072
2073
- A helper function to create a mock to replace the use of :func: `open `. It works
2074
- for :func: `open ` called directly or used as a context manager.
2075
-
2076
- The *mock * argument is the mock object to configure. If ``None `` (the
2077
- default) then a :class: `MagicMock ` will be created for you, with the API limited
2078
- to methods or attributes available on standard file handles.
2079
-
2080
- *read_data * is a string for the :meth: `~io.IOBase.read `,
2081
- :meth: `~io.IOBase.readline `, and :meth: `~io.IOBase.readlines ` methods
2082
- of the file handle to return. Calls to those methods will take data from
2083
- *read_data * until it is depleted. The mock of these methods is pretty
2084
- simplistic: every time the *mock * is called, the *read_data * is rewound to
2085
- the start. If you need more control over the data that you are feeding to
2086
- the tested code you will need to customize this mock for yourself. When that
2087
- is insufficient, one of the in-memory filesystem packages on `PyPI
2088
- <https://pypi.org> `_ can offer a realistic filesystem for testing.
2073
+ A helper function to create a mock to replace the use of :func: `open `. It works
2074
+ for :func: `open ` called directly or used as a context manager.
2075
+
2076
+ The *mock * argument is the mock object to configure. If ``None `` (the
2077
+ default) then a :class: `MagicMock ` will be created for you, with the API limited
2078
+ to methods or attributes available on standard file handles.
2079
+
2080
+ *read_data * is a string for the :meth: `~io.IOBase.read `,
2081
+ :meth: `~io.IOBase.readline `, and :meth: `~io.IOBase.readlines ` methods
2082
+ of the file handle to return. Calls to those methods will take data from
2083
+ *read_data * until it is depleted. The mock of these methods is pretty
2084
+ simplistic: every time the *mock * is called, the *read_data * is rewound to
2085
+ the start. If you need more control over the data that you are feeding to
2086
+ the tested code you will need to customize this mock for yourself. When that
2087
+ is insufficient, one of the in-memory filesystem packages on `PyPI
2088
+ <https://pypi.org> `_ can offer a realistic filesystem for testing.
2089
2089
2090
2090
.. versionchanged :: 3.4
2091
2091
Added :meth: `~io.IOBase.readline ` and :meth: `~io.IOBase.readlines ` support.
0 commit comments