Closed vladak closed 2 years ago
Yeah. Well that was actually a bug (or surprise) in 1.3.0. mock(spec=request.Response)
actually did nothing. It was like calling mock()
. (519c9c4) (What was advertised was mock(request.Response)
.)
Don't know what you're trying to do, but maybe mock({"status_code": 200}, spec=request.Response)
is what you're looking for. Or mock(request.Response, strict=False)
just to suppress the early throwing.
Aside that, mockito returning functools.partial...
is not useful here and leaky. Maybe we should return None
for all unconfigured attributes. (At least something falsy.)
I'm closing. Sorry for the unfortunate breaking change 💇♂️
I'm closing. Sorry for the unfortunate breaking change 💇♂️
No worries and thanks !
Oops, I did not close.
Normally I'd ask about this in Discussions, however they do not seem to be enabled for this project so I am misusing the issue. Since 1.3.2 (including) there has been some change in behavior.
In 1.3.0 everything is fine:
however in 1.3.2 there was some change:
which prevents the usual use cases. This is on Python 3.9.13 on macOS however happens also elsewhere.