Skip to content

Add test that IMAP4.enable() after SELECT raises an error#154186

Open
bontail wants to merge 1 commit into
python:mainfrom
bontail:add-test-enable-after-select
Open

Add test that IMAP4.enable() after SELECT raises an error#154186
bontail wants to merge 1 commit into
python:mainfrom
bontail:add-test-enable-after-select

Conversation

@bontail

@bontail bontail commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Resolve a long-standing XXX TODO in test_imaplib.py by covering the
case where enable() is called from the SELECTED state.

ENABLE is only valid in the AUTH state (Commands['ENABLE'] == ('AUTH',)),
so calling enable() after select() must raise imaplib.IMAP4.error. The
new test_enable_raises_error_after_select authenticates, selects a mailbox,
then asserts that enable('UTF8=ACCEPT') raises and does not set
utf8_enabled.

Test-only change; no behavior change.

Resolve the long-standing XXX TODO in test_imaplib.py by covering the
case where enable() is called from the SELECTED state: ENABLE is only
valid in the AUTH state, so it must raise IMAP4.error.
@bontail
bontail requested a review from a team as a code owner July 19, 2026 18:23
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 19, 2026
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant