Support specifying the spec by using the keyword spec.
Although in the documentation it is always spelt mock(SomeClass)
it is confusing to not allow the keyword invocation
mock(spec=SomeClass) here to mean the same thing.
It can be considered a bug because using the keyword spec=X just
ignored the argument and created a non-strict, non-specced (dumb) mock;
basically a plain mock().
Support specifying the spec by using the keyword
spec
.Although in the documentation it is always spelt
mock(SomeClass)
it is confusing to not allow the keyword invocationmock(spec=SomeClass)
here to mean the same thing.It can be considered a bug because using the keyword
spec=X
just ignored the argument and created a non-strict, non-specced (dumb) mock; basically a plainmock()
.This came up here: https://stackoverflow.com/questions/72498759/python-mockito-how-do-i-set-up-async-mocks?noredirect=1#comment128270001_72498759