summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-04-13 15:57:22 (GMT)
committerMichael Foord <michael@voidspace.org.uk>2012-04-13 15:57:22 (GMT)
commitc287062fcf8b891db3b982e628cb297165b766e2 (patch)
treee50e3acde7c9caa8583794e2c19916cd1422c28f /Lib/unittest/mock.py
parent633b32a7fa7ba57dbb3d7fd6fbda00595cc135c8 (diff)
downloadcpython-c287062fcf8b891db3b982e628cb297165b766e2.zip
cpython-c287062fcf8b891db3b982e628cb297165b766e2.tar.gz
cpython-c287062fcf8b891db3b982e628cb297165b766e2.tar.bz2
unittest.mock.PropertyMock return value and attributes are now standard MagicMocks
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r--Lib/unittest/mock.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 0a9aece..ec17542 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2166,6 +2166,9 @@ class PropertyMock(Mock):
Fetching a `PropertyMock` instance from an object calls the mock, with
no args. Setting it calls the mock with the value being set.
"""
+ def _get_child_mock(self, **kwargs):
+ return MagicMock(**kwargs)
+
def __get__(self, obj, obj_type):
return self()
def __set__(self, obj, val):