Skip to content

test: avoid localized messages in closed-descriptor checks - #875

Open
KennyMcSimpson wants to merge 1 commit into
tox-dev:mainfrom
KennyMcSimpson:fix/locale-independent-descriptor-check
Open

KennyMcSimpson wants to merge 1 commit into
tox-dev:mainfrom
KennyMcSimpson:fix/locale-independent-descriptor-check

Conversation

@KennyMcSimpson

Copy link
Copy Markdown

On Chinese-language Windows, test_strict_soft_sentinel_inspection_failure_closes_descriptor fails because the OS returns [WinError 6] 句柄无效。, which does not match its hard-coded English messages. The file descriptor is correctly closed.

Check OSError.errno == EBADF directly with pytest.raises(check=...), replacing the message match and subsequent errno assertion. This retains the closed-descriptor check regardless of the OS language and follows the predicate style used elsewhere in the suite.

Validation on Windows / Python 3.13:

  • The original complete suite has only this failure: 2414 passed, 544 skipped, 1 failed. The individual test reproduces it independently.
  • The final complete suite passes: 2415 passed, 544 skipped.
  • The strict-soft module passes (40 passed, 2 skipped); Ruff check/format and git diff --check pass.

Developed with OpenAI Codex assistance.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant