Skip to content

gh-161617: Fix test_clinic, test_tools, test_generated_cases with lazy imports - #161618

Merged
sobolevn merged 3 commits into
python:mainfrom
sobolevn:issue-161617
Nov 12, 2026
Merged

sobolevn merged 3 commits into
python:mainfrom
sobolevn:issue-161617

Conversation

@sobolevn

@sobolevn sobolevn commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Looks like that my change to imports_under_tool also fixed other tests.
So, I removed them from the ignore as well.

Comment thread Lib/test/support/import_helper.py Resolved
@@ -32,7 +32,7 @@ def skip_if_missing(tool=None):
@contextlib.contextmanager
def imports_under_tool(name, *subdirs):

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.

Oh wait, does it not make sense to do it here instead?

@sobolevn sobolevn Nov 8, 2026 •

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.

I don't think so, it might be required for other places that use DirsOnSysPath as well, since it is a broader API. We can alternatevly make a separate API called with forced_eager_imports(): and use it here. WDYT?

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.

Yeah, I think it is a better and more compsable API :)

@sobolevn

sobolevn commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

I also need this new context manager in #161660 :)

@brettcannon
brettcannon removed their request for review November 9, 2026 21:11
@sobolevn
sobolevn merged commit 72ba954 into python:main Nov 12, 2026
49 of 50 checks passed
@sobolevn sobolevn added the needs backport to 3.15 bugs and security fixes label Nov 12, 2026
@miss-islington-app

Copy link
Copy Markdown

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

@miss-islington-app

Copy link
Copy Markdown

Sorry, @sobolevn, I could not cleanly backport this to 3.15 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 72ba9549898f219e70a0dd2ec848a092d6e4a9c9 3.15

@bedevere-app

bedevere-app Bot commented Nov 12, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants