summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testwith.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-23 15:48:45 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-23 15:48:45 (GMT)
commit88ba360c88c412c0fe5a75ca50cf11bba08e636b (patch)
tree5663f9b8330fd997b0c377c92f5718c03244d0e6 /Lib/unittest/test/testmock/testwith.py
parent4f4913b38bba5e01fc0e7a26f4840bf342365d3d (diff)
parentca647ef60aa74e3dea81a399ded20c648a69e742 (diff)
downloadcpython-88ba360c88c412c0fe5a75ca50cf11bba08e636b.zip
cpython-88ba360c88c412c0fe5a75ca50cf11bba08e636b.tar.gz
cpython-88ba360c88c412c0fe5a75ca50cf11bba08e636b.tar.bz2
Issue #21750: Further fixup to be styled like other mock APIs.
Diffstat (limited to 'Lib/unittest/test/testmock/testwith.py')
-rw-r--r--Lib/unittest/test/testmock/testwith.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/unittest/test/testmock/testwith.py
index ddcfe77..b6bfb75 100644
--- a/Lib/unittest/test/testmock/testwith.py
+++ b/Lib/unittest/test/testmock/testwith.py
@@ -141,6 +141,7 @@ class TestMockOpen(unittest.TestCase):
def test_mock_open_context_manager(self):
mock = mock_open()
+ handle = mock.return_value
with patch('%s.open' % __name__, mock, create=True):
with open('foo') as f:
f.read()
@@ -148,8 +149,7 @@ class TestMockOpen(unittest.TestCase):
expected_calls = [call('foo'), call().__enter__(), call().read(),
call().__exit__(None, None, None)]
self.assertEqual(mock.mock_calls, expected_calls)
- # mock_open.return_value is no longer static, because
- # readline support requires that it mutate state
+ self.assertIs(f, handle)
def test_mock_open_context_manager_multiple_times(self):
mock = mock_open()