Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-121008: Fix idlelib.run tests #121046

Merged
merged 1 commit into from
Jun 26, 2024
Merged

gh-121008: Fix idlelib.run tests #121046

merged 1 commit into from
Jun 26, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 26, 2024

When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.

When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
@vstinner
Copy link
Member Author

Without this change, ./python -m test -u all,-gui test_idle test_pyrepl hangs on Linux: it is blocked until I press ENTER.

With this change, the same command no longer hangs.

Copy link
Contributor

@ambv ambv left a comment

Choose a reason for hiding this comment

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

Fixes the issue for me on Ubuntu and macOS, both GUI builds. Tests pass with:

> /Volumes/RAMDisk/installed-main/bin/python3 -E -Wd -m test --slowest --fail-env-changed -uall test_idle test_pyrepl
Using random seed: 2738848300
Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 9.16 Run 2 tests sequentially in a single process
0:00:00 load avg: 9.16 [1/2] test_idle
0:00:09 load avg: 9.14 [2/2] test_pyrepl

== Tests result: SUCCESS ==

10 slowest tests:
- test_idle: 9.3 sec
- test_pyrepl: 4.5 sec

All 2 tests OK.

Total duration: 13.9 sec
Total tests: run=740 skipped=5
Total test files: run=2/2
Result: SUCCESS

@vstinner vstinner merged commit 44eafd6 into python:main Jun 26, 2024
36 checks passed
@vstinner vstinner deleted the idle branch June 26, 2024 13:41
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 26, 2024
When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
(cherry picked from commit 44eafd6)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 26, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 26, 2024
@vstinner
Copy link
Member Author

Ok, let me merge this change and see how it goes.

Thanks for the review @ambv.

vstinner added a commit that referenced this pull request Jun 26, 2024
gh-121008: Fix idlelib.run tests (GH-121046)

When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
(cherry picked from commit 44eafd6)

Co-authored-by: Victor Stinner <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
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