_patch._active_patches is global to all patches
Larrik opened this issue · comments
Donald Morrone commented
I found this out the hard way, but when you create and start, say 5 different patches over 5 different methods, all 5 Mock objects live in a single _active_patches
list shared by all _patch
objects. This is weird behavior.
Side note, is there a better way to determine if a patch is running before trying to stop it?
Donald Morrone commented
I'm thinking this was probably intentional, but it seems odd.
Chris Withers commented
This repo is only for issues that are specific to the backport.
Please report issues with mock in the upstream bug tracker at https://bugs.python.org/.
Once issues are fixed upstream, they can be backported here.