tests: anchor the inheritance order check on the call, not the definition

source.index("_resolve_inherited_extra_args(") matched the function
definition, which always precedes the endpoint, so the ordering
assertion was vacuously true. Anchoring on "= _resolve_inherited_
extra_args(" pins the first call site inside the load endpoint (line
4505), which is the statement whose position relative to the GGUF
branch the test is meant to guard. 32 tests pass.
This commit is contained in:
Daniel Han 2026-07-19 16:21:53 +00:00
commit f5939f5948

View file

@ -730,7 +730,7 @@ class TestLoadHubDownloadExclusion:
# Pass-through inheritance runs before the GGUF branch, so a carried
# --no-mmproj shapes the hub guard's companion requirement.
assert source.index("_resolve_inherited_extra_args(") < source.index("if config.is_gguf:")
assert source.index("= _resolve_inherited_extra_args(") < source.index("if config.is_gguf:")
assert (
gguf_branch.index("enter_context(gguf_load_in_flight")
< gguf_branch.index("_hub_download_blocks_gguf_load")