Releases: 15r10nk/inline-snapshot
0.32.1
Fixed
-
Fixed handling of
datetimeandtimeobjects with timezone information. Thetzinfoparameter is now properly included in snapshots, andtimezone.utcis represented with the correct import (from datetime import timezone). -
Fixed customize hook registration to properly check if objects are functions before inspecting the
inline_snapshot_implattribute, preventing potential attribute errors when scanning conftest modules.
0.32.0 customize everything
0.32.0 — 2026-02-13
Added
pathlib.Path/PurePathvalues are now never stored asPosix/WindowsPathor their Pure variants, which improves the writing of platform independent tests.- Support for import statement generation for all types and user-customized code.
- Added a new way to customize snapshot creation with
@customize. - Added a plugin system which allows you to reuse customizations across multiple projects.
- Added support for conditional external storage to automatically store values in external files based on custom criteria (e.g., string length, data size).
- Added built-in handlers for
datetime.datetime,date,time, andtimedeltathat generate clean snapshots with proper imports. - Generates
__file__instead of the filename string of the current source file. - Uses dirty-equals
IsNow()instead of the current datetime when the time value equals the current time.
Removed
- removed support for python 3.8 because it is end-of-life
Deprecated
- Deprecated
@customize_reprwhich can be replaced with@customize.
Fixed
-
raisescatches BaseException instead of Exception. This ensures that SystemExit and KeyboardInterrupt are also caught. -
pytest --color flag is now respected
0.31.1
0.31.0
Changed
-
BREAKING CHANGE: An exception is now raised when you use
external()in files that are not inside yourtests/directory (or any other directory that you can configure with tool.inline-snapshot.test-dir). -
Users are now notified if they use the same UUID for multiple external snapshots, which can happen when copying one test as a template for a new test. The snapshots should be reset to an empty
external()and recreated with inline-snapshot.
Fixed
0.30.1
Fixed
- Disable ensure ascii in json.dump to support non-ASCII characters in external files
0.30.0
0.29.4
0.29.3
Fixed
- xdist is now detected properly.