Skip to content

Releases: 15r10nk/inline-snapshot

0.20.2

13 Feb 08:01
Compare
Choose a tag to compare

Fixed

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

  • Fixed a crash caused by the following code:

    snapshot(tuple())
    # or
    snapshot(dict())

0.20.1

04 Feb 08:02
Compare
Choose a tag to compare

Fixed

  • Fixed a windows bug with the readline module (#189)

0.20.0

01 Feb 12:01
Compare
Choose a tag to compare

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.

0.19.3

15 Jan 18:49
Compare
Choose a tag to compare

Fixed

  • raise no assertion for positional arguments inside constructor methods.

0.19.2

15 Jan 15:31
Compare
Choose a tag to compare

Fixed

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

    example:

    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"))

0.19.1

12 Jan 20:57
Compare
Choose a tag to compare

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

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

0.19.0

10 Jan 07:57
Compare
Choose a tag to compare

Added

  • You can now specify which tool you want to use to format your code by setting a format-command in your configuration.

Changed

  • BREAKING-CHANGE you have to install inline-snapshot[black] now if you want to format your code like in the previous versions. This option is not required if you use a format-command.

Fixed

  • Load default config values even if [tool.inline-snapshot] is missing.
    This makes the documented default shortcuts --review and --fix work.

0.18.2

02 Jan 11:50
Compare
Choose a tag to compare

Changed

  • added [dependency-groups] to pyproject.toml and use uv and pytest to run tests in CI.

Fixed

  • use '.model_fields' on pydantic model class and not instance. This fixes a deprecation warning in the upcomming pydantic v2.11 (#169)

0.18.1

22 Dec 10:50
Compare
Choose a tag to compare

Fixed

  • uv is now only used during test time if you run the inline-snapshot tests with pytest --use-uv
    This solves a problem if you want to package inline-snapshot in distributions (#165)

0.18.0

21 Dec 20:35
Compare
Choose a tag to compare

Added

  • Support for a new storage-dir configuration option, to tell inline-snapshot where to store data files such as external snapshots.

Fixed

  • pydantic v1 is supported again. pydantic v1 & v2 create now the same snapshots. You can use .dict() to get the same snapshots like in inline-snapshot-0.15.0 for pydantic v1.

    class M(BaseModel):
        name: str
    
    def test_pydantic():
        m = M(name="Tom")
        assert m == snapshot(M(name="Tom"))
        assert m.dict() == snapshot({"name": "Tom"})
  • Find pyproject.toml file in parent directories, not just next to the Pytest configuration file.