summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testmock.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-14 23:51:22 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-14 23:51:22 (GMT)
commita7282c0ff7aff5ed00c0355e60fcbd34c45af910 (patch)
tree99f0c17a3e75f31339c1a5bdc81f1171dab00b01 /Lib/unittest/test/testmock/testmock.py
parent34460827d6b1073fbc51c95006f63e3ad043eb4c (diff)
parent76d508b5d4bc8d69433956d6ee6309bbc31f3cf7 (diff)
downloadcpython-a7282c0ff7aff5ed00c0355e60fcbd34c45af910.zip
cpython-a7282c0ff7aff5ed00c0355e60fcbd34c45af910.tar.gz
cpython-a7282c0ff7aff5ed00c0355e60fcbd34c45af910.tar.bz2
- Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
Patch from Nicola Palumbo and Laurent De Buyst.
Diffstat (limited to 'Lib/unittest/test/testmock/testmock.py')
-rw-r--r--Lib/unittest/test/testmock/testmock.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py
index f4a723d..f4fb228 100644
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -246,6 +246,9 @@ class MockTest(unittest.TestCase):
# used to cause recursion
mock.reset_mock()
+ def test_reset_mock_on_mock_open_issue_18622(self):
+ a = mock.mock_open()
+ a.reset_mock()
def test_call(self):
mock = Mock()