Commit e304c10
Address PR #408 R2 review (1 P2 strengthen replicate-df regression)
R2 P2: the previous regression test asserted per-path inference
matches `safe_inference(..., df=results.survey_metadata.df_survey)`,
but under uniform-valid replicate fixtures every IF site reports the
same `n_valid` so the snapshot df and final df happen to coincide
and the assertion passes vacuously even when the bug is present
(per-path uses a stale snapshot df that incidentally equals the
final df).
Add `test_refresh_path_inference_called_from_final_block`: wraps the
helper with `mock.patch.object` to capture call_args, asserts (a)
helper is invoked exactly once, (b) the `df_final` it received
equals `results.survey_metadata.df_survey` — a relationship that
holds by construction when invoked from the final R2 P1b block
(which uses `_final_eff_df = _effective_df_survey(resolved_survey,
_replicate_n_valid_list)` AFTER all appends), but can only coincide
by chance when invoked from an earlier block on a fixture where
snapshot equals final.
Update the existing test's docstring to acknowledge it documents
the contract on a uniform-valid fixture and points readers at the
new mock-based test for direct call-site verification.
Use `importlib.import_module` to access the dCDH module: the
top-level `diff_diff` package re-exports the convenience function
`chaisemartin_dhaultfoeuille`, shadowing the module of the same
name in attribute lookup.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 905e887 commit e304c10
1 file changed
Lines changed: 86 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9467 | 9467 | | |
9468 | 9468 | | |
9469 | 9469 | | |
| 9470 | + | |
| 9471 | + | |
| 9472 | + | |
| 9473 | + | |
| 9474 | + | |
| 9475 | + | |
| 9476 | + | |
| 9477 | + | |
| 9478 | + | |
| 9479 | + | |
| 9480 | + | |
| 9481 | + | |
| 9482 | + | |
| 9483 | + | |
| 9484 | + | |
| 9485 | + | |
| 9486 | + | |
| 9487 | + | |
| 9488 | + | |
| 9489 | + | |
| 9490 | + | |
| 9491 | + | |
| 9492 | + | |
| 9493 | + | |
| 9494 | + | |
| 9495 | + | |
| 9496 | + | |
| 9497 | + | |
| 9498 | + | |
| 9499 | + | |
| 9500 | + | |
| 9501 | + | |
| 9502 | + | |
| 9503 | + | |
| 9504 | + | |
| 9505 | + | |
| 9506 | + | |
| 9507 | + | |
| 9508 | + | |
| 9509 | + | |
| 9510 | + | |
| 9511 | + | |
| 9512 | + | |
| 9513 | + | |
| 9514 | + | |
| 9515 | + | |
| 9516 | + | |
| 9517 | + | |
| 9518 | + | |
| 9519 | + | |
| 9520 | + | |
| 9521 | + | |
| 9522 | + | |
| 9523 | + | |
| 9524 | + | |
| 9525 | + | |
| 9526 | + | |
| 9527 | + | |
| 9528 | + | |
| 9529 | + | |
| 9530 | + | |
| 9531 | + | |
| 9532 | + | |
| 9533 | + | |
| 9534 | + | |
| 9535 | + | |
| 9536 | + | |
| 9537 | + | |
| 9538 | + | |
| 9539 | + | |
| 9540 | + | |
| 9541 | + | |
| 9542 | + | |
| 9543 | + | |
| 9544 | + | |
| 9545 | + | |
| 9546 | + | |
| 9547 | + | |
| 9548 | + | |
| 9549 | + | |
9470 | 9550 | | |
9471 | 9551 | | |
9472 | 9552 | | |
| |||
9481 | 9561 | | |
9482 | 9562 | | |
9483 | 9563 | | |
9484 | | - | |
| 9564 | + | |
| 9565 | + | |
| 9566 | + | |
| 9567 | + | |
| 9568 | + | |
| 9569 | + | |
9485 | 9570 | | |
9486 | 9571 | | |
9487 | 9572 | | |
| |||
0 commit comments