FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-152236: Fix skips on `_testcapi.set_nomemory` tests by sobolevn · Pull Request #152253 · python/cpython · GitHub

Repository navigation

gh-152236: Fix skips on _testcapi.set_nomemory tests - #152253

Merged
sobolevn merged 4 commits into
python:mainfrom
sobolevn:issue-152236
Jun 26, 2026
Merged

sobolevn merged 4 commits into
python:mainfrom
sobolevn:issue-152236

Conversation

sobolevn commented Jun 26, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Now all tests that use _testcapi.set_nomemory have all the right skips :)

support.gc_collect()

@support.cpython_only
@unittest.skipIf(support.Py_TRACE_REFS, 'cannot test Py_TRACE_REFS build')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Great idea! Working on it.

sobolevn requested a review from iritkatriel as a code owner June 26, 2026 11:57

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. It looks better with @support.nomemtest decorator!

import_module('_testcapi')
return f(*args, **kwargs)

return unittest.skipIf(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You may move the Py_TRACE_REFS comment here.

sobolevn Jun 26, 2026 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM (Ooops, I forgot to select (o) Approve).

Copy link
Copy Markdown
Member Author

Thank you for your help!

sobolevn enabled auto-merge (squash) June 26, 2026 13:02
sobolevn merged commit 1cbe460 into python:main Jun 26, 2026
91 of 93 checks passed

Copy link
Copy Markdown

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

bedevere-app Bot commented Jun 26, 2026

Copy link
Copy Markdown

GH-152281 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 26, 2026

Copy link
Copy Markdown

Sorry, @sobolevn, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 1cbe460eb6c5f40980463f381b3096c92320ff84 3.13

bedevere-app Bot commented Jun 26, 2026

Copy link
Copy Markdown

GH-152282 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 26, 2026

bedevere-app Bot commented Jun 26, 2026

Copy link
Copy Markdown

GH-152286 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 26, 2026
sobolevn added a commit that referenced this pull request Jun 26, 2026
) (#152282)

gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253)
(cherry picked from commit 1cbe460)

Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this pull request Jun 26, 2026
) (#152281)

gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253)
(cherry picked from commit 1cbe460)

Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this pull request Jun 26, 2026
) (#152286)

* [3.13] gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253)
(cherry picked from commit 1cbe460)

Co-authored-by: sobolevn <mail@sobolevn.me>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL