Repository navigation
test: document unchecked mock assertion arguments - #5049
asukaminato0721 wants to merge 1 commit into
Conversation
|
This pull request has been imported. If you are a Meta employee, you can view this in D122390435. (Because this pull request was imported automatically, there will not be any future comments.) |
Merging this PR will degrade performance by 18.46%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | invalidate_all |
30.9 ms | 37.9 ms | -18.46% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing asukaminato0721:tests-only-pr-4795 (2374578) with main (18b7584)
Footnotes
-
9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
This comment has been minimized.
This comment has been minimized.
2374578 to
d6b6185
Compare
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Summary
Mock assertion methods do not check arguments against the patched target signature. Bug-marked tests accept the current absence of diagnostics and identify the invalid arguments that should be reported. Passing control cases remain unmarked.
The
testcase!regressions usebug =markers and comments documenting the correct behavior. These are passing tests of known bugs, following the repository test guidance.The complete implementation and regression tests remain in PR #4795. Related issue: #3913.
Validation
Based on upstream
mainatef6de648bce0dc6dcca0a21a9fbb7490f23ecce8.cargo test -p pyrefly --lib -- test_assert_called_with_checks_target_signature test_patch_special_function_call_uses_target_signature test_patch_start_checks_target_signature test_async_patch_checks_await_assertion test_patch_bound_method_checks_bound_signature test_patch_new_callable_keeps_declared_result— passed.python3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema --no-extension— passed.