New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocked new_instances are not properly cleaned by teardown in Python 3 #16
Comments
Hi, thanks for the report, I'll look into it. It definitely looks like a bug and I can reproduce it. |
So I think you're hitting #13, which is caused by a bug in Python itself [1]. The weird thing is, I have Python 3.5.2 where this should already be fixed and I'm still getting the error. So either the fix is wrong or there's another problem somewhere. I'll continue investigating. |
So yeah, the fix for the underlying Python issue has been reverted. I have a feeling that it was reverted by mistake, but I'm not completely sure. I left a comment at the issue, so we'll see [1]. |
We just run into this issue in 2022. @bkabrda seems that your voice in the related Python issue in 2016 wasn't heard |
@wojtha, thank you for your suggestions. I added a warning to the documentation in PR #127. I think before we raise a warning when As a side note, this bug seems to only affect CPython. For example, PyPy doesn't suffer from this bug. |
We should probably follow up on the Python bug tracker also, it's tricky to fix this bug without this 🤔 |
Hello!
It would seem that when using
flexmock(<class>).new_instances()
in python 3.4 won't clean the bindings on the class upon calling teardown.This is an example script using latest flexmock==0.10.2 on Python 3.4.4
Output is
If i try to call MyClass without param error becomes
It works fine on Python 2.7.11
The text was updated successfully, but these errors were encountered: