Skip to content

gh-155648: Fix IDLE tests that cannot fail - #156257

Merged
terryjreedy merged 3 commits into
python:mainfrom
terryjreedy:ddbug26
Aug 24, 2026
Merged

gh-155648: Fix IDLE tests that cannot fail#156257
terryjreedy merged 3 commits into
python:mainfrom
terryjreedy:ddbug26

Conversation

@terryjreedy

@terryjreedy terryjreedy commented Aug 23, 2026

Copy link
Copy Markdown
Member

DD bug 26:
test_autocomplete.py:241 passes when proper because any([]) is True is true. It would also pass if small only had underscored words because the filter got reversed. Change logic and replace filter with generator expression
using slice instead of startswith. Change line 242 to match.

test_editor.py:236 and test_configdialog.py:55 have empty tests ('pass'); skip them for now.
PR-#156260 add real tests.

template.py:25 tests True == True; skip it. With this, the bug scanner should be satisfied while allowing
setUpClass and tearDownClass to run and be verified.

DD bug 26:
test_autocomplete.py:241 passes when proper because `any([]) is
True` is true.  It would also pass if is small only had underscored
words because the filter got reversed.  Change logic and replace
filter with generator expressions.

test_editor.py:236 and test_configdialog.py:55 have empty tests
('pass'); comment them out.
template.py:25 tests `True == True`; make another comparison.
The template fix still might fail the bug scanner, but does not
matter.  It is not run, and might not be needed any longer.
@terryjreedy terryjreedy added skip news topic-IDLE needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 23, 2026
Comment thread Lib/idlelib/idle_test/test_autocomplete.py Outdated
Comment thread Lib/idlelib/idle_test/test_editor.py Outdated
Comment thread Lib/idlelib/idle_test/template.py Outdated
@serhiy-storchaka

Copy link
Copy Markdown
Member

See #156260 which implements the tests instead of commenting them out.

@terryjreedy

Copy link
Copy Markdown
Member Author

I made a change in each file. Please re-review. I would like to merge this now as a minimal fix, and include 3.15 in the backports. I looked at the +300 lines of real tests and would like to defer them until 3.15 is unlocked.

Comment on lines 233 to 234

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.

What is the difference between these lines...

Comment thread Lib/idlelib/idle_test/test_autocomplete.py Outdated
@terryjreedy
terryjreedy merged commit ee1da7e into python:main Aug 24, 2026
52 checks passed
@miss-islington-app

Copy link
Copy Markdown

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

@bedevere-app

bedevere-app Bot commented Aug 24, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 24, 2026
@bedevere-app

bedevere-app Bot commented Aug 24, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 24, 2026
@bedevere-app

bedevere-app Bot commented Aug 24, 2026

Copy link
Copy Markdown

GH-156317 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 Aug 24, 2026
@terryjreedy
terryjreedy deleted the ddbug26 branch August 24, 2026 14:25
@terryjreedy

Copy link
Copy Markdown
Member Author

Serhiy, thank you for review. Original patch 'worked'; reviewed result is better for each file changed.

terryjreedy added a commit that referenced this pull request Aug 24, 2026
gh-155648: Fix IDLE tests that cannot fail (GH-156257)

test_autocomplete.py:241 passes when proper because any([]) is True is true. It would also pass if small only had underscored words because the filter got reversed. Change logic and replace filter with generator expression
using slice instead of startswith. Change line 242 to match.

test_editor.py:236 and test_configdialog.py:55 have empty tests ('pass'); skip them for now.
PR-GH-156260 add real tests.

template.py:25 tests True == True; skip it. With this, the bug scanner should be satisfied while allowing
setUpClass and tearDownClass to run and be verified.

Remove duplicate and confusing fetch_completions call.
(cherry picked from commit ee1da7e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
terryjreedy added a commit that referenced this pull request Aug 24, 2026
gh-155648: Fix IDLE tests that cannot fail (GH-156257)

test_autocomplete.py:241 passes when proper because any([]) is True is true. It would also pass if small only had underscored words because the filter got reversed. Change logic and replace filter with generator expression
using slice instead of startswith. Change line 242 to match.

test_editor.py:236 and test_configdialog.py:55 have empty tests ('pass'); skip them for now.
PR-GH-156260 add real tests.

template.py:25 tests True == True; skip it. With this, the bug scanner should be satisfied while allowing
setUpClass and tearDownClass to run and be verified.

Remove duplicate and confusing fetch_completions call.
(cherry picked from commit ee1da7e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Aug 24, 2026
RMenuTest and ConfigDialogTest were skipped as empty in pythonGH-156257.
They are no longer empty.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO + PGO 3.x (tier-1) has failed when building commit ee1da7e.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/29/builds/10665) and take a look at the build logs.
  4. Check if the failure is related to this commit (ee1da7e) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/29/builds/10665

Summary of the results of the build (if available):

Click to see traceback logs
Note: switching to 'ee1da7ec8e939a998d5ecf2c749d45eb8f7714e4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ee1da7ec8e93 gh-155648: Fix IDLE tests that cannot fail (#156257)
Switched to and reset branch 'main'

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3476: clean-retain-profile] Error 1 (ignored)
./Modules/socketmodule.c: In function ‘getsockaddrarg’:
./Modules/socketmodule.c:2664:9: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation]
 2664 |         strncpy((char *)sa->salg_name, name, sizeof(sa->salg_name));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar: libpython3.16.a: error reading Objects/memoryobject.o: No space left on device
make[2]: *** [Makefile:1164: libpython3.16.a] Error 1
make[1]: *** [Makefile:997: profile-gen-stamp] Error 2
make: *** [Makefile:1009: profile-run-stamp] Error 2

@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO 3.x (tier-1) has failed when building commit ee1da7e.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/271/builds/9424) and take a look at the build logs.
  4. Check if the failure is related to this commit (ee1da7e) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/271/builds/9424

Summary of the results of the build (if available):

Click to see traceback logs
Note: switching to 'ee1da7ec8e939a998d5ecf2c749d45eb8f7714e4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ee1da7ec8e93 gh-155648: Fix IDLE tests that cannot fail (#156257)
Switched to and reset branch 'main'

/usr/bin/ld.bfd: final link failed: No space left on device
collect2: error: ld returned 1 exit status
make: *** [Makefile:1792: _bootstrap_python] Error 1

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.

3 participants