Skip to content

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

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

fix(tests): skip bash tool tests on Windows#5680
danyalahmed1995 wants to merge 1 commit 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`
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