diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-11 18:16:44 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-11 18:16:44 (GMT) |
commit | 87006a3d4a6c7616ab885ae697ae60a2f62e2d7a (patch) | |
tree | a78974c5f99b64bc04fb5694d6c7947c353802b0 /Doc | |
parent | 924aaae4c2a99015ca6b448f16eed31bbb598b98 (diff) | |
download | cpython-87006a3d4a6c7616ab885ae697ae60a2f62e2d7a.zip cpython-87006a3d4a6c7616ab885ae697ae60a2f62e2d7a.tar.gz cpython-87006a3d4a6c7616ab885ae697ae60a2f62e2d7a.tar.bz2 |
Issue #20804: Document the limitation of the unittest.mock.sentinel attributes.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/unittest.mock.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index ef30c01..4b9dac4 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -1795,6 +1795,9 @@ sentinel the same attribute will always return the same object. The objects returned have a sensible repr so that test failure messages are readable. + The ``sentinel`` attributes don't preserve their identity when they are + :mod:`copied <copy>` or :mod:`pickled <pickle>`. + Sometimes when testing you need to test that a specific object is passed as an argument to another method, or returned. It can be common to create named sentinel objects to test this. :data:`sentinel` provides a convenient way of |