Skip to content

Commit ff25e91

Browse files
committed
refactor(test): add the counter id of the failed snapshot to the error message
1 parent 6a42756 commit ff25e91

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

.github/workflows/integration_delivery.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,28 @@ jobs:
281281
name: binary
282282
path: artifacts
283283

284+
- uses: actions/checkout@v4
285+
name: Checkout
286+
287+
- name: Extract Changelog
288+
id: changelog
289+
run: |
290+
perl -0777 -ne 'while (/## Version ${{ needs.build.outputs.version }}\n(\s*\n)*(.*?)(\s*\n)*## Version \d+\.\d+\.\d+\n/sg) {print "$2\n"}' CHANGELOG.md > CURRENT_CHANGELOG.md
291+
{
292+
echo "CONTENT<<EOF"
293+
cat CURRENT_CHANGELOG.md
294+
echo "EOF"
295+
} >> "$GITHUB_OUTPUT"
296+
284297
- name: Release
285298
uses: softprops/action-gh-release@v2
286299
with:
287300
files: artifacts/*
288301
tag_name: v${{ needs.build.outputs.version }}
289302
body: |
290-
Release of version ${{ needs.build.outputs.version }}
291303
PyPI package: https://pypi.org/project/${{ needs.build.outputs.name }}/${{ needs.build.outputs.version }}
304+
305+
# Changes:
306+
${{ steps.changelog.outputs.CONTENT }}
292307
prerelease: false
293308
draft: false

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Version 0.14.4
4+
5+
- refactor(test): add the counter id of the failed snapshot to the error message
6+
37
## Version 0.14.3
48

59
- fix: add `unsubscribe` method to `AutorunReturnType` protocol

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "python-redux"
3-
version = "0.14.3"
3+
version = "0.14.4"
44
description = "Redux implementation for Python"
55
authors = ["Sassan Haradji <[email protected]>"]
66
license = "Apache-2.0"

redux_pytest/fixtures/snapshot.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,7 @@ def take(self: StoreSnapshot, *, title: str | None = None) -> None:
9292
mismatch_path.write_text( # pragma: no cover
9393
f'// MISMATCH: {filename}\n{new_snapshot}\n',
9494
)
95-
if title:
96-
assert (
97-
new_snapshot == old_snapshot
98-
), f'Store snapshot mismatch for {title}'
99-
else:
100-
assert new_snapshot == old_snapshot, 'Store snapshot mismatch'
95+
assert new_snapshot == old_snapshot, f'Store snapshot mismatch - {filename}'
10196

10297
self.test_counter[title] += 1
10398

0 commit comments

Comments
 (0)