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.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_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_terminal_rows_follow_the_shared_columns()[source]

Each record fills its terminal table in the order the columns name.

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.

tests.test_dep_report.test_format_release_notes_truncates_a_long_body()[source]

A long body is cut at a line end and links the full release.

A tagless entry, the changelog link of the PyPI fallback, renders as is.

tests.test_dep_report.PAPAYA_RELEASES = {'1.0.0': False, '1.1.0': False, '1.2.0': True, '1.3.0': False, '1.3.0rc1': False}

Releases of the papaya fixture package, mapped to whether PyPI yanked them.

tests.test_dep_report.test_fetch_release_notes_lists_each_repository_once(cache_env)[source]

One listing of the releases serves every version the bump covers.

A yanked release and a pre-release inside the range are left out, the way the selection sweeps leave them out.

A package with no release notes on GitHub links its PyPI changelog instead.

A removed package is never looked up. A package with no repository, or with neither notes nor a changelog link, gets no entry.