serum icon indicating copy to clipboard operation
serum copied to clipboard

mock should be a context manager

Open suned opened this issue 6 years ago • 0 comments

With the current implementation, the empty context is the default.

This can lead to problems when using mock without a Context because any mocked types cannot be unmocked in the default context.

By changing mock to a context manager this is no longer a problem because mocks can be reset when the mock context manager closes, rather than when the context closes.

suned avatar Sep 08 '18 09:09 suned