python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

Override does not allow to override a single method in a test

Open xescuder opened this issue 2 years ago • 0 comments

Hi. From my tests I want to change return_value and side_effect of some methods, but some others I don't want to, so the real method is called.

I've tried override but if one of the methods is called that is not mocked it fails.

Could you give me advise on how to solve it?

I've tried to use mock.patch(Class, 'method', side_effect) instead override but it doesn't work.

Thanks.

xescuder avatar Sep 02 '22 07:09 xescuder