GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Don't require `_testcapi` for `test_code` by ShaharNaveh · Pull Request #152185 · python/cpython

Conversation

@ShaharNaveh

@ShaharNaveh ShaharNaveh commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

cc: @StanFromIreland

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ShaharNaveh
Don't require _testcapi for test_code
439e8cd
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels Jun 25, 2026
StanFromIreland
StanFromIreland reviewed Jun 25, 2026
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please do:

code_offset_to_line = import_helper.import_module("_testcapi").code_offset_to_line

like we have in test_newempty.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ShaharNaveh reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@StanFromIreland StanFromIreland added skip issue skip news labels Jun 25, 2026
@ShaharNaveh
Fix CR
c9f646b
ShaharNaveh
ShaharNaveh commented Jun 25, 2026
View reviewed changes
Comment thread Lib/test/test_code.py

def test_co_branches(self):
_testcapi = import_helper.import_module("_testcapi")
code_offset_to_line = _testcapi.code_offset_to_line

@ShaharNaveh ShaharNaveh Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I can make it to a single line if that's preferred, I think it looks better this way but I don't feel strongly about it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StanFromIreland
Merge branch 'main' into test-code-testcapi
ebbd24d
StanFromIreland
StanFromIreland approved these changes Jun 25, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jun 25, 2026
@StanFromIreland
StanFromIreland merged commit 11c241e into python:main Jun 25, 2026
52 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 25, 2026
@StanFromIreland StanFromIreland added awaiting merge needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Jun 25, 2026
@miss-islington-app

miss-islington-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

Thanks @ShaharNaveh for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

Thanks @ShaharNaveh for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

Thanks @ShaharNaveh for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 25, 2026
@miss-islington-app

miss-islington-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

cherry_picker 11c241e1a8a71b5f25a304b1f428467b746f5d43 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned StanFromIreland Jun 25, 2026
@bedevere-app

bedevere-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 25, 2026
@StanFromIreland StanFromIreland removed the needs backport to 3.13 only security fixes label Jun 25, 2026
StanFromIreland added a commit that referenced this pull request Jun 25, 2026
@miss-islington @ShaharNaveh @StanFromIreland
[3.14] Don't require _testcapi for test_code (GH-152185) (#152201)
f38c16a
(cherry picked from commit 11c241e)

Co-authored-by: Shahar Naveh <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
StanFromIreland added a commit that referenced this pull request Jun 25, 2026
@miss-islington @ShaharNaveh @StanFromIreland
[3.15] Don't require _testcapi for test_code (GH-152185) (#152202)
0222238
(cherry picked from commit 11c241e)

Co-authored-by: Shahar Naveh <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
@ShaharNaveh ShaharNaveh mentioned this pull request Jun 26, 2026
Don't require _testcapi and _testinternalcapi for test_monitoring.py #152311
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@StanFromIreland StanFromIreland StanFromIreland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@StanFromIreland StanFromIreland

Labels

awaiting merge skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ShaharNaveh @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.