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

Function _to_stream

Lib/unittest/mock.py:2964–2968  ·  view source on GitHub ↗
(read_data)

Source from the content-addressed store, hash-verified

2962
2963
2964def _to_stream(read_data):
2965 if isinstance(read_data, bytes):
2966 return io.BytesIO(read_data)
2967 else:
2968 return io.StringIO(read_data)
2969
2970
2971def mock_open(mock=None, read_data=''):

Callers 2

mock_openFunction · 0.85
reset_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…