Skip to content
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

Add support for magic methods #3

Open
jsatt opened this issue Aug 17, 2015 · 2 comments
Open

Add support for magic methods #3

jsatt opened this issue Aug 17, 2015 · 2 comments

Comments

@jsatt
Copy link
Contributor

jsatt commented Aug 17, 2015

Magic methods in Python are set differently then normal attributes, making them difficult to mock out. This would allow Fake instances to be used as context managers.

@kumar303
Copy link
Contributor

I once looked at how hard it would be to make mock the backend for fudge. It's very doable. This would make a lot of sense since mock is part of the stdlib now. There was one patch that fudge needed (I forget what it is) but it was merged into mock a long time ago. It would greatly simplify all of fudge's patching code and fix a lot of bugs since it isn't as robust as mock's.

@jsatt
Copy link
Contributor Author

jsatt commented Aug 18, 2015

@kumar303, I've long been considering a fudge-like library to abstract a lot Mock's interface (even before we contacted you about working on fudge) and had planned to get your thoughts on making a fudge 2.0 or separate project to make that happen.

This was just a pain point I was banging my head against for a while today before I realized the problem, and I think it could be fixed in fudge's current state (but way easier with a Mock backend). I found a work around that I'm still fleshing out and I may bang on this once I'm clear on the right generic solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants