[New-bugs-announce] [issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch

Dave McNulla report at bugs.python.org
Mon Sep 27 17:28:08 EDT 2021


New submission from Dave McNulla <mcnulla at gmail.com>:

https://gist.github.com/dmcnulla/ecec8fc96a2fd07082f240eeff6888d9
I'm trying to reproduce an error in a call to a method, forcing a second call to the method. In my test, the call_args_list is showing incorrectly (both in debugging or running unittest normally).

I am not certain what other circumstances this is happening or not happening. I was able to reduce the code to reproduce it quite a bit. I am certain that the first call to the method is not matching correctly in my criteria to what I expect based on my debugging.

I am using python 3.7. I can reproduce in IntelliJ or by commandline `python3 -m pytest test_multiple_side_effect.py`

----------
components: Tests
messages: 402743
nosy: dmcnulla
priority: normal
severity: normal
status: open
title: Incorrect record of call_args_list when using multiple side_effect in mock.patch
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45305>
_______________________________________


More information about the New-bugs-announce mailing list