fix(tests): make the IP-Adapter slow test runnable again - #9562
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
test_ip_adapter_unet_patch asks for a `model_installer` fixture that no longer exists and passes install_and_load_model(model_installer=...), whose parameter has been `model_manager` since the model-manager refactor. It also asks for `torch_device`, which is defined in invokeai/backend/util/test_utils.py but is not imported into any conftest, so pytest cannot resolve it either. - use the `mm2_model_manager` fixture (already star-imported into tests/conftest.py) and pass it as `model_manager=` - import `torch_device` in tests/conftest.py, which is what the comment at the top of that file already claims happens, and is the convention the file documents for fixtures that trip F401/F811 - drop `model_installer` from that comment and fix the stale `mm2_model_manager` arg name in the install_and_load_model docstring The test is @pytest.mark.slow, excluded by the default `-m "not slow"`, which is why this went unnoticed.
Anai-Guo
requested review from
JPPhoto,
Pfannkuchensack,
blessedcoolant,
dunkeroni and
lstein
as code owners
August 30, 2026 23:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tests/backend/ip_adapter/test_ip_adapter.py::test_ip_adapter_unet_patchcannotrun. It is
@pytest.mark.slow, which the defaultaddopts = ... -m "not slow"excludes, so nothing surfaces it.Three things are wrong:
model_installerfixture that does not exist anywhere inthe tree.
install_and_load_model(model_installer=...), but that parameterhas been
model_managersince the model-manager refactor(
invokeai/backend/util/test_utils.py:24).torch_device, defined atinvokeai/backend/util/test_utils.py:15but not imported into anyconftest, so pytest cannot resolve that one either.
tests/conftest.pyline 5 still says— but neither import is actually there any more.
Fix
mm2_model_manager(already star-imported intotests/conftest.pyviatests.backend.model_manager.model_manager_fixtures) and pass it asmodel_manager=torch_deviceintests/conftest.py. That is what the comment alreadyclaims, and the same file documents this as the convention for fixtures that
trip F401/F811 — importing it in the test module instead produces two
F811sagainst
build_dummy_sd15_unet_input(torch_device)and the test signaturemodel_installerfrom that comment, and fix the docstringArgs:entryin
install_and_load_model, which still calls the parametermm2_model_managerVerification
The test downloads models, so I have not run it. What is checked statically —
signature parsed out of
test_utils.pyonmain, fixtures grepped from theactual files rather than code search:
ruff checkandruff format --checkwith the repopyproject.tomlreportexactly the same results on the patched files as on
main— no new findings.Happy to also just delete the test instead if it is considered dead; it looked
worth keeping since
-m "slow"is a documented way to run it.🤖 Generated with Claude Code