This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients cjw296, mariocj89, michael.foord, miss-islington, nedbat, pablogsal, xtreak
Date 2019-04-13.19:33:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555184002.29.0.800776102715.issue36593@roundup.psfhosted.org>
In-reply-to
Content
An interesting thing is that there is GCC in CI that runs under coverage which also passed since this requires a Python tracing function before importing mock to trigger this as in the original report. Adding a simple tracer at the top of testmock.py file does cause an instance check failure without patch and passes with the merged patch.

$ ./python.exe Lib/unittest/test/testmock/testmock.py
.......................................F.................s..............................................F.......
======================================================================
FAIL: test_class_assignable (__main__.MockTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/unittest/test/testmock/testmock.py", line 1828, in test_class_assignable
    self.assertIsInstance(mock, int)
AssertionError: <Mock spec='int' id='4405923920'> is not an instance of <class 'int'>

======================================================================
FAIL: test_spec_class (__main__.MockTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/unittest/test/testmock/testmock.py", line 775, in test_spec_class
    self.assertIsInstance(mock, X)
AssertionError: <Mock spec='X' id='4405437744'> is not an instance of <class '__main__.MockTest.test_spec_class.<locals>.X'>

----------------------------------------------------------------------
Ran 112 tests in 3.834s

FAILED (failures=2, skipped=1)
History
Date User Action Args
2019-04-13 19:33:22xtreaksetrecipients: + xtreak, nedbat, cjw296, michael.foord, mariocj89, pablogsal, miss-islington
2019-04-13 19:33:22xtreaksetmessageid: <1555184002.29.0.800776102715.issue36593@roundup.psfhosted.org>
2019-04-13 19:33:22xtreaklinkissue36593 messages
2019-04-13 19:33:22xtreakcreate