Skip to content

Commit 6b5476c

Browse files
author
Martin Møldrup
committed
Prepare release 0.4.0, add changelog and version
1 parent 8a0f487 commit 6b5476c

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ All notable changes to this project will be documented in this file.
33

44
*NOTE:* Version 0.X.X might have breaking changes in bumps of the minor version number. This is because the project is still in early development and the API is not yet stable. It will still be marked clearly in the release notes.
55

6+
## [0.4.0]
7+
- 🆕 Add support for pandas DataFrame assertions (pandas is an optional dependency, and snappylapy can be used without it)
8+
- 🆕 Add new simpler and more intuitive Expect API. We can use expect() calls and an overload will select the appropriate Expect class based on the type of the input. This is in contrast with expect.dict(), expect.list(), etc. This is not a breaking change, since the old API is still supported.
9+
610
## [0.3.2]
7-
- Bug fix of test_directory fixture, not loading correctly depending fixture
11+
- 🐞 Bug fix of test_directory fixture, not loading correctly depending fixture
812

913
## [0.3.1]
1014
- 🐞 Fix load_snapshot fixture not loading correctly

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_snapshot_dict(expect: Expect):
4747
"""Test snapshot with dictionary data."""
4848
data: dict = my_function()
4949
expect.dict(data).to_match_snapshot()
50+
# or expect(data).to_match_snapshot()
5051
```
5152

5253
In this example, `snappylapy` captures the output of `my_function` and compares it against a stored snapshot. If the output changes unexpectedly, pytest will flag the test, allowing you to review the differences and ensure your code behaves as expected.
@@ -100,26 +101,26 @@ Supported data types
100101

101102
Planned data types:
102103

103-
| Python Type | Default Output file type | Implementation Status |
104-
|---------------------|--------------------------|-----------------------|
105-
| bytes | .txt ||
106-
| pd.DataFrame | .csv | |
107-
| pd.Series | .csv ||
108-
| np.ndarray | .csv ||
109-
| dict | .json ||
110-
| list | .json ||
111-
| tuple | .json ||
112-
| set | .json ||
113-
| str | .txt ||
114-
| int | .txt ||
115-
| float | .txt ||
116-
| bool | .txt ||
117-
| datetime.datetime | .txt ||
118-
| datetime.date | .txt ||
119-
| datetime.time | .txt ||
120-
| pathlib.Path | .txt ||
121-
| decimal.Decimal | .txt ||
122-
| uuid.UUID | .txt ||
104+
| Python Type | Default Output file type | Implementation Status |
105+
|---------------------|--------------------------|---------------------------|
106+
| bytes | .txt | |
107+
| pd.DataFrame | .csv | ✅ (missing csv support) |
108+
| pd.Series | .csv | |
109+
| np.ndarray | .csv | |
110+
| dict | .json | |
111+
| list | .json | |
112+
| tuple | .json | |
113+
| set | .json | |
114+
| str | .txt | |
115+
| int | .txt | |
116+
| float | .txt | |
117+
| bool | .txt | |
118+
| datetime.datetime | .txt | |
119+
| datetime.date | .txt | |
120+
| datetime.time | .txt | |
121+
| pathlib.Path | .txt | |
122+
| decimal.Decimal | .txt | |
123+
| uuid.UUID | .txt | |
123124

124125

125126

docs/index.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11

22

33
--8<-- "README.md"
4-
5-
## Design Decisions
6-
### Why not match automatically based on the type of the value?
7-
**Why require the user to provide the type when using expect fixture (e.g. expect.string("Hello world")), instead of inferring it from the value type (e.g. expect('Hello world'))?**
8-
9-
This is done for better code editor code completions and better type checking. When using ctrl+space in the code editor, the user will see the available options and documentation for the type. Even though it is bit more verbose, it is more explicit and and allows for a better developer experience.
10-

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies = [
1010
"typing-extensions ; python_full_version == '3.9.*'",
1111
]
1212
name = "snappylapy"
13-
version = "0.3.2"
13+
version = "0.4.0"
1414
description = "A snapshot library for python optimized for easy of use, human readable snapshots and enabling decoupling of chained integration tests."
1515
readme = "README.md"
1616
classifiers = [

0 commit comments

Comments
 (0)