tests.test_dev_release module

Tests for repomatic.github.dev_release: the rolling dev pre-release sync.

tests.test_dev_release.unreleased_changelog(tmp_path)[source]

A changelog on disk whose newest section is still unreleased.

tests.test_dev_release.patch_gh(**mock_kwargs)[source]

The conftest patch_gh, bound to this module’s dispatch points.

The asset upload runs through repomatic.github.releases, so its run_gh_command is patched with the same mock, keeping one call sequence.

Return type:

Generator[Mock, None, None]

tests.test_dev_release.test_sync_dev_release_dry_run(unreleased_changelog)[source]

Dry-run reports without calling gh.

tests.test_dev_release.test_sync_dev_release_live(unreleased_changelog)[source]

Live mode creates a new draft pre-release when none is listed.

tests.test_dev_release.test_sync_dev_release_never_duplicates_on_a_failed_edit(unreleased_changelog)[source]

A listed release whose edit fails is reported, never created again.

A draft carries no tag, so GitHub accepts a second draft of the same name: falling back to a creation would publish two dev pre-releases.

tests.test_dev_release.test_sync_dev_release_refuses_to_create_blind(unreleased_changelog)[source]

When the releases cannot be listed, nothing is created.

tests.test_dev_release.test_sync_dev_release_edits_existing(unreleased_changelog)[source]

Edits existing release to preserve assets instead of delete+recreate.

tests.test_dev_release.test_sync_dev_release_cleans_stale_releases(unreleased_changelog)[source]

Stale dev releases from previous versions are cleaned up.

tests.test_dev_release.test_sync_dev_release_empty_body(tmp_path)[source]

Returns False when changelog section produces an empty body.

tests.test_dev_release.test_sync_dev_release_body_content(unreleased_changelog)[source]

Verifies the release body includes changelog changes.

tests.test_dev_release.test_cleanup_dev_releases_deletes_all_dev_tags()[source]

Deletes all releases whose tag ends with a .devN segment.

tests.test_dev_release.test_cleanup_dev_releases_no_dev_releases()[source]

No-op when no dev releases exist.

tests.test_dev_release.test_cleanup_dev_releases_list_failure()[source]

Silently succeeds when release listing fails.

tests.test_dev_release.test_cleanup_dev_releases_delete_failure()[source]

Continues cleaning when individual deletions fail.

tests.test_dev_release.test_cleanup_dev_releases_keeps_current_tag()[source]

Preserves the current version’s dev release when keep_tag is set.

tests.test_dev_release.test_delete_release_by_tag_success()[source]

Calls gh release delete with the given tag, and reports the deletion.

tests.test_dev_release.test_delete_release_by_tag_immutable()[source]

Silently succeeds for immutable published releases, reporting no deletion.

tests.test_dev_release.test_delete_release_by_tag_leaves_naming_to_the_caller(caplog)[source]

The generic helper never calls what it deleted a “dev release”.

tests.test_dev_release.test_delete_release_assets_success()[source]

Deletes assets and returns count.

tests.test_dev_release.test_delete_release_assets_no_release()[source]

Returns 0 when the release does not exist.

tests.test_dev_release.test_delete_release_assets_empty()[source]

Returns 0 when the release has no assets.

tests.test_dev_release.test_delete_release_assets_partial_failure()[source]

Continues when individual asset deletions fail.

tests.test_dev_release.test_upload_release_assets_success(tmp_path)[source]

Uploads matching files and skips unrelated ones.

tests.test_dev_release.test_upload_release_assets_no_files(tmp_path)[source]

Returns empty list and makes no gh calls when no matching files.

tests.test_dev_release.test_upload_release_assets_deletes_existing_first(tmp_path)[source]

Deletes existing assets before uploading new ones.

tests.test_dev_release.test_sync_dev_release_with_assets(unreleased_changelog, tmp_path)[source]

End-to-end: metadata sync + asset upload.

tests.test_dev_release.test_sync_dev_release_dry_run_with_assets(unreleased_changelog, tmp_path)[source]

Dry-run previews asset files without making gh calls.

tests.test_dev_release.dev_project(tmp_path, monkeypatch, unreleased_changelog)[source]

A project at an unreleased version, with its changelog, as the working dir.

tests.test_dev_release.test_sync_dev_release_cmd_syncs_the_current_version(dev_project, args, dry_run)[source]

The release mirrors the version and the repository the changelog names.

tests.test_dev_release.test_sync_dev_release_cmd_deletes_instead_of_syncing(dev_project, args, message)[source]

--delete removes the dev releases, and creates none.

tests.test_dev_release.test_sync_dev_release_cmd_refuses_assets_to_delete(dev_project)[source]

There is no release left to attach assets to after --delete.

tests.test_dev_release.test_sync_dev_release_cmd_skips_without_version_or_changelog(dev_project, missing)[source]

With no version or no changelog to read, no release is touched.

tests.test_dev_release.test_sync_dev_release_cmd_reports_a_failed_sync(dev_project)[source]

A release GitHub refused ends on a clean error.