MCPcopy Index your code
hub / github.com/python/cpython / mock_open

Method mock_open

Lib/test/test_sax.py:208–211  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

206 fileobj = None
207
208 def mock_open(*args):
209 nonlocal fileobj
210 fileobj = builtin_open(*args)
211 return fileobj
212
213 with mock.patch('xml.sax.saxutils.open', side_effect=mock_open):
214 make_xml_file(self.data, 'iso-8859-1', None)

Calls

no outgoing calls

Tested by

no test coverage detected