summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2011-10-29 23:20:08 +0100
committerMichael Foord <michael@voidspace.org.uk>2011-10-29 23:20:08 +0100
commit84b07a1efc95746f1c6295439f839b85a5d0911e (patch)
treee05d4caea358de3202ead61b3dae1210acc88724 /tests
parent1e3ea20f6b3f63c5463cf775251abc7b9f1e9b49 (diff)
downloadmock-84b07a1efc95746f1c6295439f839b85a5d0911e.tar.gz
Use weakrefs to avoid circular references
Diffstat (limited to 'tests')
-rw-r--r--tests/testmagicmethods.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/testmagicmethods.py b/tests/testmagicmethods.py
index 392ad96..d066b76 100644
--- a/tests/testmagicmethods.py
+++ b/tests/testmagicmethods.py
@@ -449,6 +449,12 @@ class TestMockingMagicMethods(unittest2.TestCase):
self.assertIsInstance(foo.__int__, Foo)
+ def test_descriptor_from_class(self):
+ m = MagicMock()
+ type(m).__str__.return_value = 'foo'
+ self.assertEqual(str(m), 'foo')
+
+
if __name__ == '__main__':
unittest2.main()