Commit 8e8025a
test: assert the contract arun can actually keep, not the mis-bind
test_extra_positional_args_reach_run came in with kyegomez#1871 and asserts that
arun(task, img, "EXTRA") forwards "EXTRA" positionally to run(). That is
the behaviour this PR removes, so the test locked the defect in.
It only ever passed because its stub is declared
`fake_run(*args, **kwargs)`, which accepts anything positionally and so
cannot observe where the argument actually lands. Against the real
signature it lands on `imgs`:
>>> inspect.signature(Agent.run).bind_partial(None, "T", "I", "EXTRA")
{'task': 'T', 'img': 'I', 'imgs': 'EXTRA'}
`imgs` is a List[str] of image paths, not run()'s own *args.
Replaced with two tests that use a stub with the real parameter names,
so a mis-bind is visible:
- task/img/kwargs reach run() as themselves
- a third positional raises TypeError at the arun boundary instead of
being silently bound to imgs
The second fails on master's agent.py and passes here, which is the
whole point of the change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 42a3f99 commit 8e8025a
3 files changed
Lines changed: 50 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
| 464 | + | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
| |||
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
| |||
587 | 592 | | |
588 | 593 | | |
589 | 594 | | |
590 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
591 | 599 | | |
592 | 600 | | |
593 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2926 | 2926 | | |
2927 | 2927 | | |
2928 | 2928 | | |
2929 | | - | |
2930 | | - | |
2931 | | - | |
2932 | | - | |
2933 | | - | |
| 2929 | + | |
| 2930 | + | |
2934 | 2931 | | |
2935 | 2932 | | |
2936 | 2933 | | |
2937 | 2934 | | |
2938 | 2935 | | |
2939 | | - | |
2940 | | - | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
2941 | 2939 | | |
2942 | 2940 | | |
2943 | 2941 | | |
2944 | 2942 | | |
2945 | 2943 | | |
2946 | | - | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
2947 | 2947 | | |
2948 | 2948 | | |
2949 | | - | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
2950 | 2976 | | |
2951 | 2977 | | |
2952 | 2978 | | |
| |||
0 commit comments