summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest
diff options
context:
space:
mode:
authorSamet YASLAN <sametyaslan@gmail.com>2023-06-11 18:51:21 (GMT)
committerGitHub <noreply@github.com>2023-06-11 18:51:21 (GMT)
commit3f7c0810f6158a7ff37be432f8d7f9511427489f (patch)
tree2d7aa6981b6b921ac8da80696cc568bf4e712c70 /Lib/test/test_unittest
parent18d16e93b6d4b7b10c5145890daa92b760fe962a (diff)
downloadcpython-3f7c0810f6158a7ff37be432f8d7f9511427489f.zip
cpython-3f7c0810f6158a7ff37be432f8d7f9511427489f.tar.gz
cpython-3f7c0810f6158a7ff37be432f8d7f9511427489f.tar.bz2
bpo-44185: Added close() to mock_open __exit__ (#26902)
Diffstat (limited to 'Lib/test/test_unittest')
-rw-r--r--Lib/test/test_unittest/testmock/testwith.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_unittest/testmock/testwith.py b/Lib/test/test_unittest/testmock/testwith.py
index 8dc8eb1..56cb163 100644
--- a/Lib/test/test_unittest/testmock/testwith.py
+++ b/Lib/test/test_unittest/testmock/testwith.py
@@ -158,7 +158,7 @@ class TestMockOpen(unittest.TestCase):
f.read()
expected_calls = [call('foo'), call().__enter__(), call().read(),
- call().__exit__(None, None, None)]
+ call().__exit__(None, None, None), call().close()]
self.assertEqual(mock.mock_calls, expected_calls)
self.assertIs(f, handle)
@@ -172,9 +172,9 @@ class TestMockOpen(unittest.TestCase):
expected_calls = [
call('foo'), call().__enter__(), call().read(),
- call().__exit__(None, None, None),
+ call().__exit__(None, None, None), call().close(),
call('bar'), call().__enter__(), call().read(),
- call().__exit__(None, None, None)]
+ call().__exit__(None, None, None), call().close()]
self.assertEqual(mock.mock_calls, expected_calls)
def test_explicit_mock(self):