Inline-snapshot

Latest version: v0.21.1

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

Scan your dependencies

Page 1 of 10

0.21.1

Changed

- trailing white spaces in multi-line strings are now terminated with an `\n\`.
python
def test_something():
assert "a \nb\n" == snapshot(
"""\
a \n\
b
"""
)


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

0.21.0

Changed

- inline-snapshot uses now `--inline-snapshot=disable` during CI runs by default.
This improves performance because `snapshot()` is then equal to:
python
def snapshot(x):
return x

It also has benefits for the accuracy of your tests as it is less likely that inline snapshot will affect your tests in CI.

- The default flags have changed for cpython >= 3.11:
* `--inline-snapshot=create,review` is used in an interactive terminal and
* `--inline-snapshot=report` otherwise.

- The categories in the terminal output are now links to the documentation if it is supported by the terminal.

Fixed

- Hide update section if the diff is empty because the change is reverted by the format-command.

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

0.20.10

Fixed

- Use of the correct snapshot category (update/fix) when deleting dataclass arguments.

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

0.20.9

Fixed

- `--inline-snapshot=create` preserves test failures now.

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

0.20.8

Fixed

- inline-snapshot now also works if you use `--no-summary` (which pycharm does if you run your tests from the IDE).

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

0.20.7

Changed

- Tests with failed snapshot comparisons now always result in a pytest `Error`, even if snapshots have been fixed or created.

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

Page 1 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.