aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/unittest/test/testmock/testmagicmethods.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/testmock/testmagicmethods.py')
-rw-r--r--Lib/unittest/test/testmock/testmagicmethods.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/unittest/test/testmock/testmagicmethods.py
index bd52e2589b9..2bcf08801e4 100644
--- a/Lib/unittest/test/testmock/testmagicmethods.py
+++ b/Lib/unittest/test/testmock/testmagicmethods.py
@@ -345,6 +345,14 @@ class TestMockingMagicMethods(unittest.TestCase):
self.assertEqual(mock[1][2][3], 3)
+ def test_magic_method_reset_mock(self):
+ mock = MagicMock()
+ str(mock)
+ self.assertTrue(mock.__str__.called)
+ mock.reset_mock()
+ self.assertFalse(mock.__str__.called)
+
+
def test_dir(self):
# overriding the default implementation
for mock in Mock(), MagicMock():