Return a mock for the builtin `open()` method in `module_name`.
(request: FixtureRequest, module_name: str, **kwargs: Any)
| 109 | |
| 110 | |
| 111 | def open_mock(request: FixtureRequest, module_name: str, **kwargs: Any): |
| 112 | """Return a mock for the builtin `open()` method in `module_name`.""" |
| 113 | target = "%s.open" % module_name |
| 114 | _patch = patch(target, mock_open(), create=True, **kwargs) |
| 115 | request.addfinalizer(_patch.stop) |
| 116 | return _patch.start() |
| 117 | |
| 118 | |
| 119 | def property_mock(request: FixtureRequest, cls: type, prop_name: str, **kwargs: Any): |
no outgoing calls
searching dependent graphs…