[Misc] Cleanup: use consistent pytest-mock in unit tests#2698
Conversation
hsliuustc0106
left a comment
There was a problem hiding this comment.
Looks like a clean migration from unittest.mock to pytest-mock across the test suite. One thing to double-check:
conftest.py now uses ModuleType("comfy_api") stubs instead of MagicMock. If any test later accesses an attribute that doesn't exist on these stubs, it'll raise AttributeError instead of returning a mock — which is probably the intended behavior, but worth verifying the comfyui integration tests still pass with the exact attributes they touch.
|
Test-only refactor, looks clean. Two notes:
|
|
There still exist other |
Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
2fed5b7 to
537c830
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
I think we'd better add the preferred way of applying mock/patch (i.e., |
…t#2698) Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
…t#2698) Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
…t#2698) Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
This is a followup of already resolved #1291 . With more code merged developers still mixed together and used
unittest.mock. We'd better write the recommended way to doc.This PR made a cleanup to existing unit tests so that they apply consistent
pytest-mock, while keeping test logics intact.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model. Please runmkdocs serveto sync the documentation editions to./docs.BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)