summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMax BĂ©langer <aeromax@gmail.com>2018-10-25 21:48:58 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-10-25 21:48:58 (GMT)
commit6c83d9f4a72905d968418bef670bb3091d2744db (patch)
tree36e86ffe12d882014bed38909a417a6f713b2e93 /Doc
parent1770d1c5121ed6c64d7072875738f97e07eede8a (diff)
downloadcpython-6c83d9f4a72905d968418bef670bb3091d2744db.zip
cpython-6c83d9f4a72905d968418bef670bb3091d2744db.tar.gz
cpython-6c83d9f4a72905d968418bef670bb3091d2744db.tar.bz2
bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960)
The MagicMock class supports many magic methods, but not __fspath__. To ease testing with modules such as os.path, this function is now supported by default.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/unittest.mock.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index 136804c..0ae2954 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -1699,6 +1699,10 @@ The full list of supported magic methods is:
* Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``
* Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``,
``__getnewargs__``, ``__getstate__`` and ``__setstate__``
+* File system path representation: ``__fspath__``
+
+.. versionchanged:: 3.8
+ Added support for :func:`os.PathLike.__fspath__`.
The following methods exist but are *not* supported as they are either in use