Path to this page:
./
devel/py-inline-snapshot,
Golden master/snapshot/approval testing library
Branch: CURRENT,
Version: 0.19.3,
Package name: py312-inline-snapshot-0.19.3,
Maintainer: pkgsrc-usersinline-snapshot can be used for different things:
* golden master/approval/snapshot testing. The idea is that you
have a function with a currently unknown result and you want
to write a tests, which ensures that the result does not change
during refactoring.
* Compare things which are complex like lists with lot of numbers
or complex data structures.
* Things which might change during the development like error
messages.
inline-snapshot automates the process of recording, storing and
updating the value you want to compare with. The value is converted
with repr() and stored in the source file as argument of the
snapshot() function.
Master sites:
Filesize: 86.559 KB
Version history: (Expand)
- (2025-01-16) Updated to version: py312-inline-snapshot-0.19.3
- (2025-01-14) Updated to version: py312-inline-snapshot-0.19.1
- (2025-01-09) Updated to version: py312-inline-snapshot-0.18.2
- (2024-11-11) Package added to pkgsrc.se, version py312-inline-snapshot-0.14.0 (created)
CVS history: (Expand)
2025-01-16 09:31:43 by Adam Ciarcinski | Files touched by this commit (2) | |
Log message:
py-inline-snapshot: updated to 0.19.3
0.19.3 — 2025-01-15
Fixed
- raise no assertion for positional arguments inside constructor methods.
0.19.2 — 2025-01-15
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"))
|
2025-01-14 09:38:21 by Adam Ciarcinski | Files touched by this commit (2) | |
Log message:
py-inline-snapshot: updated to 0.19.1
0.19.1 — 2025-01-12
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))
```
0.19.0 — 2025-01-10
Added
- You can now specify which tool you want to use to format your code by setting \
a `format-command` in your \
[configuration](https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command).
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.
|
2025-01-09 11:32:25 by Adam Ciarcinski | Files touched by this commit (3) | |
Log message:
py-inline-snapshot: updated to 0.18.2
0.18.2 — 2025-01-02
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
0.18.1 — 2024-12-22
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
0.18.0 — 2024-12-21
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.
``` python
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.
|
2024-11-11 10:00:47 by Thomas Klausner | Files touched by this commit (4) |
Log message:
devel/py-inline-snapshot: import py-inline-snapshot-0.14.0
inline-snapshot can be used for different things:
* golden master/approval/snapshot testing. The idea is that you
have a function with a currently unknown result and you want
to write a tests, which ensures that the result does not change
during refactoring.
* Compare things which are complex like lists with lot of numbers
or complex data structures.
* Things which might change during the development like error
messages.
inline-snapshot automates the process of recording, storing and
updating the value you want to compare with. The value is converted
with repr() and stored in the source file as argument of the
snapshot() function.
|