@@ -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
The ``sentinel `` attributes don't preserve their identity when they are
1836
1836
:mod: `copied <copy> ` or :mod: `pickled <pickle> `.
@@ -2069,22 +2069,22 @@ mock_open
2069
2069
2070
2070
.. function :: mock_open(mock=None, read_data=None)
2071
2071
2072
- A helper function to create a mock to replace the use of :func: `open `. It works
2073
- for :func: `open ` called directly or used as a context manager.
2074
-
2075
- The *mock * argument is the mock object to configure. If ``None `` (the
2076
- default) then a :class: `MagicMock ` will be created for you, with the API limited
2077
- to methods or attributes available on standard file handles.
2078
-
2079
- *read_data * is a string for the :meth: `~io.IOBase.read `,
2080
- :meth: `~io.IOBase.readline `, and :meth: `~io.IOBase.readlines ` methods
2081
- of the file handle to return. Calls to those methods will take data from
2082
- *read_data * until it is depleted. The mock of these methods is pretty
2083
- simplistic: every time the *mock * is called, the *read_data * is rewound to
2084
- the start. If you need more control over the data that you are feeding to
2085
- the tested code you will need to customize this mock for yourself. When that
2086
- is insufficient, one of the in-memory filesystem packages on `PyPI
2087
- <https://pypi.org> `_ can offer a realistic filesystem for testing.
2072
+ A helper function to create a mock to replace the use of :func: `open `. It works
2073
+ for :func: `open ` called directly or used as a context manager.
2074
+
2075
+ The *mock * argument is the mock object to configure. If ``None `` (the
2076
+ default) then a :class: `MagicMock ` will be created for you, with the API limited
2077
+ to methods or attributes available on standard file handles.
2078
+
2079
+ *read_data * is a string for the :meth: `~io.IOBase.read `,
2080
+ :meth: `~io.IOBase.readline `, and :meth: `~io.IOBase.readlines ` methods
2081
+ of the file handle to return. Calls to those methods will take data from
2082
+ *read_data * until it is depleted. The mock of these methods is pretty
2083
+ simplistic: every time the *mock * is called, the *read_data * is rewound to
2084
+ the start. If you need more control over the data that you are feeding to
2085
+ the tested code you will need to customize this mock for yourself. When that
2086
+ is insufficient, one of the in-memory filesystem packages on `PyPI
2087
+ <https://pypi.org> `_ can offer a realistic filesystem for testing.
2088
2088
2089
2089
.. versionchanged :: 3.4
2090
2090
Added :meth: `~io.IOBase.readline ` and :meth: `~io.IOBase.readlines ` support.
0 commit comments