Skip to content

Commit 196f421

Browse files
hf-kkleinKonstantin
and
Konstantin
authored
add snapshot tests (#292)
Co-authored-by: Konstantin <konstantin.klein+github@hochfrequenz.de>
1 parent dc56681 commit 196f421

20 files changed

+2630
-1435
lines changed

pyproject.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ spellcheck = [
4949
"codespell==2.3.0"
5050
]
5151
tests = [
52-
"pytest==8.3.3"
52+
"pytest==8.3.3",
53+
"syrupy==4.7.2"
5354
]
5455
type_check = [
5556
"mypy==1.13.0",
@@ -110,3 +111,6 @@ sources = ["src"]
110111
# build-backend = "setuptools.build_meta"
111112

112113
# [tool.setuptools_scm]
114+
[tool.pytest.ini_options]
115+
pythonpath = ["."]
116+
markers = ["snapshot: mark a test as a snapshot test"]

tox.ini

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ deps =
1919
setenv = PYTHONPATH = {toxinidir}/src
2020
commands = python -m pytest --basetemp={envtmpdir} {posargs}
2121

22+
[testenv:snapshots]
23+
# the tests environment is called by the Github action that runs the unit tests
24+
deps =
25+
-r requirements.txt
26+
.[tests]
27+
setenv = PYTHONPATH = {toxinidir}/src
28+
commands = python -m pytest -m snapshot --basetemp={envtmpdir} {posargs} --snapshot-update
29+
2230
[testenv:linting]
2331
# the linting environment is called by the Github Action that runs the linter
2432
deps =

unittests/__snapshots__/test_table_to_graph.ambr

+1,388
Large diffs are not rendered by default.

unittests/output/E_0003.dot.svg

+45-64
Loading

unittests/output/E_0003.puml.svg

+1-1
Loading

unittests/output/E_0003_with_background.dot.svg

+40-42
Loading

0 commit comments

Comments
 (0)