Inline-snapshot

Latest version: v0.20.2

Safety actively analyzes 706259 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 8

0.20.2

Fixed

- snapshots inside tests which are marked as xfail are now ignored (184)

- Fixed a crash caused by the following code:

python
snapshot(tuple())
or
snapshot(dict())


<a id='changelog-0.20.1'></a>

0.20.1

Fixed

- Fixed a windows bug with the readline module (189)

<a id='changelog-0.20.0'></a>

0.20.0

Changed

- pytest assert rewriting works now together with inline-snapshot if you use `cpython>=3.11`

- `...` is now a special value to *create* snapshot values.
The value change in `assert [5,4] == snapshot([5,...])` is now a *create* (previously it was a *fix*)

Fixed

- fixed some issues with dataclass arguments

- fixed an issue where --inline-snapshot=review discarded the user input and never formatted
the code if you used cpython 3.13.

<a id='changelog-0.19.3'></a>

0.19.3

Fixed

- raise no assertion for positional arguments inside constructor methods.

<a id='changelog-0.19.2'></a>

0.19.2

Fixed

- fixed a crash when you changed the snapshot to use a custom constructor method for dataclass/pydantic models.

example:
python
from inline_snapshot import snapshot
from pydantic import BaseModel


class A(BaseModel):
a: int

classmethod
def from_str(cls, s):
return cls(a=int(s))


def test_something():
assert A(a=2) == snapshot(A.from_str("1"))


<a id='changelog-0.19.1'></a>

0.19.1

Added

- added the optional `inline-snapshot[dirty-equals]` dependency to depend on the dirty-equals version which works in combination with inline-snapshot.

Fixed

- snapshots with pydantic models can now be compared multiple times

python
class A(BaseModel):
a: int


def test_something():
for _ in [1, 2]:
assert A(a=1) == snapshot(A(a=1))


<a id='changelog-0.19.0'></a>

Page 1 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.