pytest-dev/pytest-mock

.context_manager() only works for object mocking

Closed this issue · 3 comments

There should be both mocker.patch.context_manager and mocker.patch.object_context_manager.

Thanks @eugenenelou. PRs are welcome!

I can do one, but my naming proposal would be a breaking change, maybe you want another?

Hmm yeah, you are right. In that case I'm not sure it is worth doing, as one can always just use unittest.mock then.

Closing for now, feel free to follow up though.