aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/unittest/test/testmock/testmock.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-15 11:42:28 +1200
committerRobert Collins <rbtcollins@hp.com>2015-07-15 11:42:28 +1200
commitb37f43f94b693468d8b3b9dfc84b1930c52a1b61 (patch)
tree172fa92019a9728252f64417321ecb9fee36cef4 /Lib/unittest/test/testmock/testmock.py
parentacb3a4d88bdee64096ed4f00c9d464b6b4513658 (diff)
downloadcpython-b37f43f94b693468d8b3b9dfc84b1930c52a1b61.tar.gz
cpython-b37f43f94b693468d8b3b9dfc84b1930c52a1b61.zip
- 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 23675b9af6b..4fe63149136 100644
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -237,6 +237,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()