Name the operation in retry warnings, share the attempts constant

This commit is contained in:
J. Nick Koston
2026-08-20 02:03:08 -05:00
parent f38dd28b2e
commit ee82f77487
4 changed files with 22 additions and 7 deletions
+3 -1
View File
@@ -647,9 +647,10 @@ def test_has_remote_file_changed_retries_transient_error(
mock_requests_head: MagicMock,
mock_retry_sleep: MagicMock,
setup_core: Path,
caplog: pytest.LogCaptureFixture,
) -> None:
"""A HEAD revalidation that fails transiently then returns 304 does not
mark the cached copy stale."""
mark the cached copy stale, and the retry warning names the operation."""
test_file = setup_core / "cached.txt"
test_file.write_bytes(b"cached content")
@@ -669,6 +670,7 @@ def test_has_remote_file_changed_retries_transient_error(
assert test_file not in external_files._run_data().stale_paths
assert mock_requests_head.call_count == 2
assert mock_retry_sleep.call_args_list == [call(2)]
assert "Revalidation of" in caplog.text
def test_download_content_skip_external_update_uses_cache(