[hipFile/Python] Add missing fake async classes/functions - #8953
Conversation
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
|
Ignore @therock-pr-bot . conftest.py is a test file... |
The Async Python API was added after the initial unit tests were merged, but the Async PR (#7386) did not add any unit tests itself. This quick fix addresses the import issue faced. Actual unit tests for async will be added at a later point.
There was a problem hiding this comment.
Pull request overview
Fixes the hipFile Python test suite failing at collection by updating the tests’ fake hipfile._hipfile module to include the async API symbols that hipfile/file.py imports at module load.
Changes:
- Add a
_FakeAsyncIOHandlestand-in for the extension’sAsyncIOHandle. - Add fake async/stream functions (
hipFileReadAsync,hipFileWriteAsync,hipFileStreamRegister,hipFileStreamDeregister) andsupports_async()to the fake module.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0053503 to
584c930
Compare
(#8953) ## Motivation The hipFile Python test suite has been broken at collection since the async I/O bindings (#7386): that PR added `AsyncIOHandle` and the async/stream callables to the extension and imported them in `file.py`, but never updated the fake in `conftest.py`. Every test importing `hipfile` errored during collection. Missed because CI wasn't re-run after the unit tests (#8725) landed. ## Technical Details Add the missing async names to the fake extension in `conftest.py`: a `_FakeAsyncIOHandle` stand-in plus success-shaped `hipFileReadAsync` / `hipFileWriteAsync` / `hipFileStreamRegister` / `hipFileStreamDeregister` / `supports_async`. Tests-only change. ## Issue Tracking JIRA ID: AIHIPFILE-171 ## Test Plan - Run the hipFile Python binding suite: `pytest projects/hipfile/python/tests/`. - Lint the changed file: `black --check` and `pylint` on `conftest.py`. ## Test Result - `42 passed` (previously: 5 collection errors, suite could not run). - `black --check`: file left unchanged. `pylint`: rated 10.00/10. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. [rocm-systems] ROCm/rocm-systems#8953 (commit 5284381)
Motivation
The hipFile Python test suite has been broken at collection since the async I/O
bindings (#7386): that PR added
AsyncIOHandleand the async/stream callables tothe extension and imported them in
file.py, but never updated the fake inconftest.py. Every test importinghipfileerrored during collection. Missedbecause CI wasn't re-run after the unit tests (#8725) landed.
Technical Details
Add the missing async names to the fake extension in
conftest.py: a_FakeAsyncIOHandlestand-in plus success-shapedhipFileReadAsync/hipFileWriteAsync/hipFileStreamRegister/hipFileStreamDeregister/supports_async. Tests-only change.Issue Tracking
JIRA ID: AIHIPFILE-171
Test Plan
pytest projects/hipfile/python/tests/.black --checkandpylintonconftest.py.Test Result
42 passed(previously: 5 collection errors, suite could not run).black --check: file left unchanged.pylint: rated 10.00/10.Submission Checklist