gh-152236: Fix skips on _testcapi.set_nomemory tests#152253
Conversation
| support.gc_collect() | ||
|
|
||
| @support.cpython_only | ||
| @unittest.skipIf(support.Py_TRACE_REFS, 'cannot test Py_TRACE_REFS build') |
There was a problem hiding this comment.
You didn't copy the comment oon Py_TRACE_REFS skip which makes this skip mysterious.
What do you think of adding a decorator to test.support which would do @support.cpython_only + @unittest.skipIf(support.Py_TRACE_REFS) with all needed comments explaining why Py_TRACE_REFS is skipped?
There was a problem hiding this comment.
Great idea! Working on it.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. It looks better with @support.nomemtest decorator!
| import_module('_testcapi') | ||
| return f(*args, **kwargs) | ||
|
|
||
| return unittest.skipIf( |
There was a problem hiding this comment.
You may move the Py_TRACE_REFS comment here.
There was a problem hiding this comment.
I would prefer to keep it :)
I moved it closer to the Py_TRACE_REFS definition.
It was really helpful for me when I first learned about this skip rule.
vstinner
left a comment
There was a problem hiding this comment.
LGTM (Ooops, I forgot to select (o) Approve).
|
Thank you for your help! |
|
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-152281 is a backport of this pull request to the 3.15 branch. |
|
Sorry, @sobolevn, I could not cleanly backport this to |
|
GH-152282 is a backport of this pull request to the 3.14 branch. |
|
GH-152286 is a backport of this pull request to the 3.13 branch. |
Now all tests that use
_testcapi.set_nomemoryhave all the right skips :)_testcapi.set_nomemorymiss some skips #152236