bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing by tirkarthi · Pull Request #12790 · python/cpython
tirkarthi
changed the title
bpo-36598: Fix isinstance check for Mock objects with spec executed under tracing
bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Apr 13, 2019…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 added a commit that referenced this pull request
Apr 13, 2019…nder tracing (GH-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters