unstale

pypi / inline-snapshot

inline-snapshot

What changed in inline-snapshot 0.30 to 0.37, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

5 breaking1 deprecations13 new APIs and options6 performance13 behavior and defaults4 tooling24 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

inline-snapshot 0.371 changes

New APIs and options 1

  • Extensions can use is_snapshot() to recognize inline and external snapshot objects.

    0.37.0release notes

inline-snapshot 0.369 changes

Breaking changes 1

  • Built-in literal values are always managed; registering their types as unmanaged now raises TypeError.

    0.36.1release notes

New APIs and options 1

  • The hook receives the corresponding existing snapshot value, or ... when there is no corresponding snapshot.

    0.36.0release notes

Performance 5

  • Reduces memory use by eagerly recording snapshot changes without retaining completed test frames until the final report.

    0.36.2release notes

  • Comparisons avoid unnecessary deep copies of immutable built-in values.

    0.36.1release notes

  • Conversion of literal constants is faster, especially for large lists and dictionaries.

    0.36.1release notes

  • Conversion reads AST constant values directly instead of compiling and evaluating them.

    0.36.1release notes

  • Source representations are generated only when needed, improving performance when comparing matching snapshots with updates disabled.

    0.36.1release notes

Behavior and default changes 1

  • Registrations are scoped to the current snapshot context and inherited from the parent context.

    0.36.1release notes

Fixes and other changes 1

  • The short report now hides snapshot representation change messages when show-updates is disabled.

    0.36.1release notes

inline-snapshot 0.357 changes

New APIs and options 1

  • Added Builder.create_set() for creating set expressions in customization functions.

    0.35.3release notes

Behavior and default changes 2

  • Tracks source files that use external snapshots and uses the list to detect and trim unused external snapshots.

    0.35.0release notes

  • Used only as a compatibility fallback when files_using_external.txt does not exist yet.

    0.35.0release notes

Fixes and other changes 4

  • Trimming no longer changes snapshots when a test fails or pytest is limited to selected tests; skipped tests and fixture teardown errors do not block it. An explicit trim request overrides the safeguard.

    0.35.4release notes

  • Fixed a crash during session finalization when pytest's capture plugin is disabled.

    0.35.4release notes

  • Providing an unknown --inline-snapshot flag no longer crashes, runs report finalization, or modifies external snapshot tracking files.

    0.35.3release notes

  • Serialization is deterministic for partially ordered values such as incomparable frozenset members.

    0.35.3release notes

inline-snapshot 0.343 changes

New APIs and options 1

  • Accepts which="new" or which="old" to select the new just-compared or old previously stored snapshot value.

    0.34.0release notes

Fixes and other changes 2

  • Uses the fix category instead of create when creating an argument with an existing non-ellipsis default argument value.

    0.34.1release notes

  • Makes test order deterministic by using -p no:ranodmly.

    0.34.0release notes

inline-snapshot 0.3314 changes

Breaking changes 1

  • reported_categories uses snapshot_arg(), changes from list[Category] to set[Category], and is asserted only when categories differ from CLI flags passed via args.

    0.33.0release notes

New APIs and options 3

  • New method formats a Python file in the example using Black.

    0.33.0release notes

  • New method checks whether a Python file in the example is already Black-formatted.

    0.33.0release notes

  • New helper lets you move snapshot() calls from the call site into the helper function itself.

    0.33.0release notes

Behavior and default changes 6

  • The raises, stderr, and changed_files arguments use snapshot_arg(), so snapshot() is no longer needed at the call site; raises defaults to "<no exception>" and changed_files to {}.

    0.33.0release notes

  • Exception strings in raises are formatted like inline_snapshot.extra.raises, producing shorter strings for small assertions.

    0.33.0release notes

  • The error assertion is performed only on Python 3.11 and later.

    0.33.0release notes

  • stdout and stderr are printed as Rich panels instead of plain text.

    0.33.0release notes

  • The stdout and stderr arguments use snapshot_arg(), so snapshot() is no longer needed at the call site.

    0.33.0release notes

  • The value argument is now handled with snapshot_arg().

    0.33.0release notes

Tooling 3

  • The returncode, error, stderr, changed_files, and outcomes arguments use snapshot_arg(), removing the need for call-site snapshot(); returncode defaults to 0, changed_files to {}, and outcomes to {"passed": 1}.

    0.33.0release notes

  • The exception argument uses snapshot_arg(), so snapshot() is no longer needed at the call site.

    0.33.0release notes

  • The expected_warnings argument uses snapshot_arg(), so snapshot() is no longer needed at the call site.

    0.33.0release notes

Fixes and other changes 1

  • repr(external_file(...)) now uses a path relative to the calling file instead of an absolute path, fixing incorrect reprs on Windows.

    0.33.0release notes

inline-snapshot 0.3224 changes

Breaking changes 1

  • Support for Python 3.8 has been removed because it is end-of-life.

    0.32.0release notes

Deprecations 1

  • @customize_repr is deprecated and can be replaced with @customize.

    0.32.0release notes

New APIs and options 6

  • Added a parameter for injecting context managers that stay active during show_report().

    0.32.4release notes

  • Values can be stored in external files automatically based on custom criteria, such as string length or data size.

    0.32.0release notes

  • The new @customize decorator provides a way to customize snapshot creation.

    0.32.0release notes

  • Built-in handlers for datetime.datetime, date, time, and timedelta generate clean snapshots with proper imports.

    0.32.0release notes

  • Import statement generation is supported for all types and user-customized code.

    0.32.0release notes

  • A plugin system lets developers reuse customizations across multiple projects.

    0.32.0release notes

Performance 1

  • Improved snapshot() performance by using lazy evaluation.

    0.32.3release notes

Behavior and default changes 2

  • Generated snapshots use __file__ instead of the current source file's filename string.

    0.32.0release notes

  • When a time value equals the current time, snapshots use dirty-equals IsNow() instead of the current datetime.

    0.32.0release notes

Fixes and other changes 13

  • Fixed comparison of dict snapshots with dataclass instances or other custom objects as keys, preventing entries from collapsing or duplicate keys from being appended on subsequent runs.

    0.32.7release notes

  • Tuple snapshot updates now compare elements positionally rather than using sequence alignment, preserving existing expressions when elements are added or removed.

    0.32.7release notes

  • Snapshots for Pydantic models, attrs and dataclasses now wrap NewType-typed field values with the NewType constructor on Python 3.10 and later.

    0.32.6release notes

  • Fixed problems caused by tuples used as snapshot keys having the same hash value.

    0.32.5release notes

  • Filtering tests with -k no longer causes an error during session teardown when matchers are used.

    0.32.4release notes

  • Fixed code generation for Call objects created with builder.create_call().

    0.32.3release notes

  • The handler for datetime types is now used only for concrete types, not subclasses.

    0.32.3release notes

  • Tuples in snapshots are no longer converted internally into lists when evaluated more than once.

    0.32.2release notes

  • Timezone information is now included in snapshots, and timezone.utc is represented with the correct import.

    0.32.1release notes

  • Customize hook registration checks that objects are functions before inspecting the inline_snapshot_impl attribute, preventing potential attribute errors when scanning conftest modules.

    0.32.1release notes

  • Path and PurePath values are never stored as PosixPath, WindowsPath, or their Pure variants, improving platform-independent tests.

    0.32.0release notes

  • The pytest --color flag is now respected.

    0.32.0release notes

  • raises catches BaseException instead of Exception, so SystemExit and KeyboardInterrupt are also caught.

    0.32.0release notes

inline-snapshot 0.315 changes

Breaking changes 2

  • Format commands using pipelines now fail if any command returns a non-zero exit code, rather than checking only the last command.

    0.31.1release notes

  • Using external outside tests/ (or a configured test-dir) now raises an exception.

    0.31.0release notes

Behavior and default changes 1

  • Users are notified when multiple external snapshots use the same UUID, which can happen when copying a test as a template.

    0.31.0release notes

Fixes and other changes 2

  • The lookup for external snapshots has been improved.

    0.31.0release notes

  • Session hints now use --inline-snapshot instead of --snapshot.

    0.31.0release notes

inline-snapshot 0.303 changes

Behavior and default changes 1

  • The test-dir config option can now also be a list of paths.

    0.30.0release notes

Tooling 1

Fixes and other changes 1

  • Disables ASCII escaping in json.dump so non-ASCII characters in external files are supported.

    0.30.1release notes