freeze_schema_fixtures#

lsst.images.tests.freeze_schema_fixtures(directory, *, package='lsst.images')#

Move ordinary development fixtures to their finalized versions.

Parameters:
  • directory (Path) – Directory holding the fixture tree.

  • package (str, default: 'lsst.images') – Package whose schemas to freeze; see available_schema_classes.

Returns:

One (written, removed) pair per fixture that was frozen.

Return type:

list [ tuple [ pathlib.Path, pathlib.Path ] ]

Raises:

SchemaFixtureError – If a target path already exists or an as_shipped development fixture cannot be frozen without rewriting its preserved bytes.

Notes

Writes the final-version fixture from the .dev fixture’s content in canonical form, which normalizes the stamp from X.Y.Z.devN to X.Y.Z, then deletes the .dev file. Every ordinary variant is carried over.

An as_shipped fixture cannot be frozen: changing its embedded development stamp would violate its byte-preservation contract, while copying it unchanged under a final-version filename would make the stamp and filename disagree. Such a fixture must be replaced with bytes from a genuinely final-version shipped artifact before freezing.

All targets, source reads, and conflicts are checked before any file is written or deleted, so a predictable validation or target conflict cannot leave a partially frozen fixture tree.

This writes and deletes files; it never invokes version control. Staging the addition and the deletion is left to the caller.

This page was last modified on .