viiccwen opened a new pull request, #1147:
URL: https://github.com/apache/mahout/pull/1147

   ### Related Issues
   
   closes #1146
   
   ### Changes
   
   - [x] Bug fix
   - [ ] New feature
   - [x] Refactoring
   - [x] Documentation
   - [x] Test
   - [ ] CI/CD pipeline
   - [ ] Other
   
   ### Why
   
   This PR moves QDP Python tests into the top-level `testing/qdp_python/` 
tree, switches the default Python test run to single-process (no `-n auto`), 
documents optional use of `-n auto` / `-n N` for faster runs, and fixes ty 
diagnostics for the affected tests.
   
   ### How
   
   #### Test layout
   - **Moved** `qdp/qdp-python/tests/test_dlpack_validation.py` → 
`testing/qdp_python/test_dlpack_validation.py`
   - **Moved** `qdp/qdp-python/tests/test_quantum_data_loader.py` → 
`testing/qdp_python/test_quantum_data_loader.py`
   
   All Python tests are now under `testing/` and discovered by root `pytest` 
with `testpaths = ["testing"]`.
   
   #### Makefile
   - `test_python` now runs:  
     `uv run pytest --cov --cov-report=term-missing --cov-report=html:htmlcov`  
     (single process; coverage sources from `[tool.coverage.run]` in pyproject 
when set).
   
   #### Documentation
   - **docs/qdp/testing.md**
     - Added "Python tests" section: how to run (`make test_python` or `uv run 
pytest ...`).
     - Clarified that tests run in a single process by default to avoid GPU 
memory pressure.
     - Documented optional speed-up with `-n auto` or `-n N` when compute/GPU 
allow.
   - **qdp/DEVELOPMENT.md**
     - Updated QDP Python test path from `qdp/qdp-python/tests` to 
`testing/qdp_python`.
   
   #### Type-checking (ty)
   - **pyproject.toml**
     - Added `qumat_qdp` and `qumat_qdp.*` to `allowed-unresolved-imports` so 
the optional `qumat_qdp.loader` import does not cause unresolved-import errors.
   - **testing/qdp_python/test_quantum_data_loader.py**
     - Introduced `loader_cls` fixture that skips when `QuantumDataLoader` is 
not available and returns the class (for type narrowing).
     - Replaced all `QuantumDataLoader(...)` usages with `loader_cls(...)` and 
removed redundant `assert QuantumDataLoader is not None`.
     - Dropped unnecessary `# type: ignore` on the import fallback.
   - **testing/qumat/test_parameter_binding.py**
     - Assigned `get_backend_config(backend_name)` to a variable, added `assert 
cfg is not None`, then used `cfg.copy()` to satisfy ty 
(`possibly-missing-attribute` on optional dict).
   
   #### Other
   - **uv.lock**
     - Reflects current dependency resolution (e.g. qumat-qdp editable); any 
change shown is from lock refresh.
   
   ## Checklist
   
   - [x] Added or updated unit tests for all changes
   - [x] Added or updated documentation for all changes
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to