diff options
author | Michael Foord <michael@voidspace.org.uk> | 2011-10-29 23:20:08 +0100 |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2011-10-29 23:20:08 +0100 |
commit | 84b07a1efc95746f1c6295439f839b85a5d0911e (patch) | |
tree | e05d4caea358de3202ead61b3dae1210acc88724 /tests | |
parent | 1e3ea20f6b3f63c5463cf775251abc7b9f1e9b49 (diff) | |
download | mock-84b07a1efc95746f1c6295439f839b85a5d0911e.tar.gz |
Use weakrefs to avoid circular references
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testmagicmethods.py | 6 |
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() |