Closed WisdomPill closed 3 years ago
Hi @WisdomPill,
looking at what changed between 3.9.3
and 3.9.4
I'd say it's probably something related to decorator
version pinning. I need to test and probably pin the correct version, in case it's related to that. If you'd like to spend more time on it, I'd suggest to test different versions of decorator
and figure out which one fails.
Thanks for opening this issue.
Sorry for the delay. I've just opened a bug here.
The problem is related to using decorator>=5
.
All good, you can pip install mocket==3.9.41
which excludes decorator>=5
.
Thanks!
Describe the bug In my project when I upgraded
mocket
I noticed an issue on all the tests that had@mocketize
decorator and@patches
(fromunittest.mock
package). I tried different versions and it seems to me that from3.9.4
there is the issue. I am using django'sTestCase
I am sure the issue is showing up regardless of the content of the test and without anysetUp
ortearDown
methods. I also tried with python's plainunittest.TestCase
with the following code and the issue still happens.The error is the following, it seems to me that the function does not get the patches as arguments.
To Reproduce This is complicated, I am sure the only change that makes the tests fail is to upgrade
mocket
after3.9.4
included, with3.9.3
it works fine. I am trying to setup a dummy repo but the issue does not show up.Expected behavior The patches should be passed as arguments as usual.
I tested only with python 3.7 regardless of the environment, on docker with
python3.7-alpine
and on my mac usingpyenv
.Additional context I am sorry I did not provide further details but I can't share the code which is having the issue, I will try to create a dummy project with the same dependencies as mine and work my way down removing dependencies. It will take me some time but in the meantime I am opening the issue hoping that maybe you can spot the problem before that.
For the moment my workaround is to use
Mocketizer
as context manager