Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Test assertion fails on Chinese system locale #1472

Copy link
Copy link
@mingo1996

Description

@mingo1996
Issue body actions

Initial Checks

Description

When running the test suite on a Chinese (Simplified, zh_CN) Windows system, one of the assertions failed due to language differences.

Environment

  • OS: Windows 11 (Simplified Chinese)
  • Python version: 3.11

Expected Behavior

The test should pass regardless of system language.

Actual Behavior

The test fails with an AssertionError:
Image

Suggestion

In Windows, it is modified to determine based on error codes.

assert (
    "nonexistent" in error_message
    or "not found" in error_message.lower()
    or "[winerror 2]" in error_message  # or "cannot find the file" in error_message.lower()  # Windows error message
)

Example Code

uv run pytest tests/client/test_stdio.py::test_stdio_client_nonexistent_command

Python & MCP Python SDK

Python version: 3.11
MCP Python SDK:latest
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesNice to haves, rare edge casesbugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.