summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testhelpers.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/test/testmock/testhelpers.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/test/testmock/testhelpers.py')
-rw-r--r--Lib/unittest/test/testmock/testhelpers.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/unittest/test/testmock/testhelpers.py
index 3674778..a2ed100 100644
--- a/Lib/unittest/test/testmock/testhelpers.py
+++ b/Lib/unittest/test/testmock/testhelpers.py
@@ -831,5 +831,16 @@ class TestCallList(unittest.TestCase):
p.stop()
+ def test_propertymock_returnvalue(self):
+ m = MagicMock()
+ p = PropertyMock()
+ type(m).foo = p
+
+ returned = m.foo
+ p.assert_called_once_with()
+ self.assertIsInstance(returned, MagicMock)
+ self.assertNotIsInstance(returned, PropertyMock)
+
+
if __name__ == '__main__':
unittest.main()