Skip to content

fix(tests): skip bash tool tests on Windows#5680

Open
danyalahmed1995 wants to merge 5 commits into
google:mainfrom
danyalahmed1995:fix/windows-skip-bash-tool-test
Open

fix(tests): skip bash tool tests on Windows#5680
danyalahmed1995 wants to merge 5 commits into
google:mainfrom
danyalahmed1995:fix/windows-skip-bash-tool-test

Conversation

@danyalahmed1995
Copy link
Copy Markdown

Summary

This fixes Windows test collection for tests/unittests/tools/test_bash_tool.py.

The test module imports Python's resource module at import time, but resource is Unix-only and unavailable on Windows. As a result, running the targeted test on Windows fails during collection before pytest can report a skip.

This change adds a module-level Windows skip before importing resource.

Validation

Ran on Windows 10 with Python 3.12:

  • python -m pytest tests/unittests/tools/test_bash_tool.py -q
  • python -m pytest tests/unittests/platform -q
  • python -m pytest tests/unittests/utils/test_env_utils.py -q

Skips `test_bash_tool.py` at module level on Windows because it imports Python's Unix-only `resource` module during collection.

Validation:
- `python -m pytest tests/unittests/tools/test_bash_tool.py -q`
- `python -m pytest tests/unittests/platform -q`
- `python -m pytest tests/unittests/utils/test_env_utils.py -q`
- `git diff --check`
@rohityan rohityan self-assigned this May 18, 2026
@rohityan rohityan added tools [Component] This issue is related to tools request clarification [Status] The maintainer need clarification or more information from the author labels May 18, 2026
@rohityan
Copy link
Copy Markdown
Collaborator

Hi @danyalahmed1995 ,Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you please fix the failing pre-commit test by running autoformat.sh.

@danyalahmed1995
Copy link
Copy Markdown
Author

@rohityan Thanks, I ran the failing pyink hook directly and pushed the formatting update.

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

Labels

request clarification [Status] The maintainer need clarification or more information from the author tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants