bpo-36155: Check for identity on test_gc.test_get_objects by pablogsal · Pull Request #12116 · python/cpython

@pablogsal

@pablogsal

@pablogsal

Tested manually:

./python.exe -m test -m test_gc
....
Total duration: 1 min 55 sec
Tests result: SUCCESS

@tirkarthi

One more way to test this. Below passes with PR but fails on master as per https://bugs.python.org/issue36155#msg336903

./python.exe -m unittest unittest.test.testmock test.test_gc
.................................................................................................................................................................s..................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 404 tests in 8.209s

OK (skipped=1)

@pablogsal

One more way to test this. Below passes with PR but fails on master as per https://bugs.python.org/issue36155#msg336903

./python.exe -m unittest unittest.test.testmock test.test_gc
.................................................................................................................................................................s..................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 404 tests in 8.209s

OK (skipped=1)

This is the one I was using:

./python.exe -m test  test_asyncio test_gc -m test_gc  -v

until I found the real cause of the problem (the unnitest.mock._ANY). ;)

tirkarthi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM since it uses is to check object presence that fixes mock.ANY which always returns True for == .