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

Support for classes that define __new__ for mock_constructor #155

Open
fornellas opened this issue Apr 9, 2020 · 1 comment
Open

Support for classes that define __new__ for mock_constructor #155

fornellas opened this issue Apr 9, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed mock_constructor

Comments

@fornellas
Copy link
Contributor

It currently has no support for classes with __new__, and will reject patching those.

IIRC, it was tough getting around Python idiosyncrasies to make mock_constructor work, and I willingly decided not to implement __new__ at first to simplify things, but this is potentially doable.

@fornellas fornellas added enhancement New feature or request help wanted Extra attention is needed labels Apr 9, 2020
@fornellas fornellas added this to the mock_constructor milestone Apr 9, 2020
@fornellas fornellas removed this from the mock_constructor milestone Apr 9, 2020
@deathowl deathowl self-assigned this Apr 12, 2020
@fornellas
Copy link
Contributor Author

@deathowl I just remembered there's an in-depth documentation of the trickery behind mock_constructor here. I think things should work, as we're not touching __new__ from the class, would have to test things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed mock_constructor
Projects
None yet
Development

No branches or pull requests

2 participants