Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Apr 13, 2019

In Python having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. This is due to the usage of super() in some class methods, as this sets the class attribute. To avoid this, as a workaround, alias the usage of super .
(cherry picked from commit 830b43d)

Co-authored-by: Xtreak tir.karthi@gmail.com

https://bugs.python.org/issue36593

…nder tracing (pythonGH-12790)

In Python having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. This is due to the usage of super() in some class methods, as this sets the __class__ attribute. To avoid this, as a workaround, alias the usage of super .
(cherry picked from commit 830b43d)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
@miss-islington
Copy link
Contributor Author

@tirkarthi and @pablogsal: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit f3a9d72 into python:3.7 Apr 13, 2019
@miss-islington miss-islington deleted the backport-830b43d-3.7 branch April 13, 2019 19:32
@miss-islington
Copy link
Contributor Author

@tirkarthi and @pablogsal: Status check is done, and it's a success ✅ .

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants