tests.test_dep_report module

Golden renders and date-formatting checks for the shared report module.

Every dependency updater’s PR body is assembled from repomatic.deps.dep_report, so the exact markdown these functions emit is a user-visible contract shared by sync-uv-lock, sync-deps, sync-dep-sources, the three version-sync bumpers, and audit --fix. The tables are asserted verbatim rather than probed for substrings: a stray column, a lost separator row, or a changed link shape is exactly the kind of drift a in x assertion sails past.

tests.test_dep_report.CHANGES = [('apricot', '1.2.0', '1.3.0'), ('blueberry', '', '0.4.1'), ('cherry', '2.0.0', '')]

One change of each shape: an upgrade, an addition, and a removal.

tests.test_dep_report.test_parse_iso_datetime(value, expected)[source]
tests.test_dep_report.test_format_upload_date(value, expected)[source]
tests.test_dep_report.test_format_released(raw_upload, reference, expected)[source]
tests.test_dep_report.test_format_diff_table_without_upload_times()[source]
tests.test_dep_report.test_format_diff_table_with_every_decoration()[source]

Released column, cooldown note, links, and a comparison URL together.

tests.test_dep_report.test_format_diff_table_empty_changes()[source]
tests.test_dep_report.test_format_diff_table_override_alone_forces_released_column()[source]

An override on a changed name turns the column on without upload times.

tests.test_dep_report.test_format_diff_table_override_for_unchanged_name_is_ignored()[source]

A label sits outside the comparison link, so both stay clickable.

tests.test_dep_report.test_format_exclude_newer_note_empty()[source]
tests.test_dep_report.test_format_held_back_table()[source]
tests.test_dep_report.test_format_held_back_table_empty()[source]
tests.test_dep_report.test_build_held_back_formats_both_dates()[source]
tests.test_dep_report.test_build_held_back_without_a_date()[source]

A datasource that reports no date still yields a row, minus the dates.

tests.test_dep_report.test_format_bypass_section_covers_every_lifecycle_state()[source]

Active, frozen, cleared, unreleased and unlocked entries share one table.

tests.test_dep_report.test_format_bypass_section_warns_about_a_stale_comment()[source]

A cleared entry the table’s comment still names gets a warning.

tests.test_dep_report.test_format_bypass_section_empty()[source]
tests.test_dep_report.test_build_comparison_urls_detects_the_tag_prefix()[source]
tests.test_dep_report.test_build_comparison_urls_skips_tagless_notes()[source]

A changelog-link fallback proves the tags do not exist: emit no URL.

fetch_release_notes falls back to a bare changelog link (an empty tag) only when it found no GitHub release for the range. Guessing a v prefix there put a 404 in the PR body.

tests.test_dep_report.test_build_comparison_urls_needs_both_versions(changes)[source]
tests.test_dep_report.test_build_comparison_urls_skips_unknown_packages()[source]
tests.test_dep_report.test_format_diff_table_call_sites_pass_reference_date()[source]

Every PR-report call site opts into the humanized Released delta.

reference_date drives the relative hint on the Released column; a call site omitting it renders bare dates, as fix-vulnerable-deps once did while the other dependency updaters showed the delta.

tests.test_dep_report.test_format_release_notes_nests_headings()[source]

The h3 section holds h4 version headings, with upstream bodies below.

The section heading is an h3 so it nests under the PR body’s h2 update table, and the embedded upstream body’s own headings are demoted below the h4 version heading instead of colliding with the PR’s h2 sections.