bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing by tirkarthi · Pull Request #12790 · python/cpython

@tirkarthi

@tirkarthi 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

Apr 11, 2019

pablogsal

@tirkarthi

@tirkarthi

pablogsal

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>