From 917780d73b905c06cddb5a88be76fc270285d564 Mon Sep 17 00:00:00 2001 From: Frank Hoffmann <15r10nk-git@polarbit.de> Date: Sun, 10 Dec 2023 11:15:28 +0100 Subject: [PATCH] docs: feature list in README --- README.md | 9 +++++++++ docs/outsource.md | 2 +- tests/test_docs.py | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72a957b5..f2412abf 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,15 @@ You can install "inline-snapshot" via [pip](https://pypi.org/project/pip/): pip install inline-snapshot ``` +## Features + +* easy semantics, because `snapshot(x)` can be seen as `x` +* support for `x == snapshot(...)`, `x <= snapshot(...)`, `x in snapshot(...)` and `snapshot(...)[key]` +* black formatting is preserved +* snapshots can be stored in external files with `outsource(data)` +* pytest integration +* complete [documentation](https://15r10nk.github.io/inline-snapshot/) + ## Usage You can use `snapshot()` instead of the value which you want to compare with. diff --git a/docs/outsource.md b/docs/outsource.md index b8d53c57..2d42fa1d 100644 --- a/docs/outsource.md +++ b/docs/outsource.md @@ -6,7 +6,7 @@ This has the advantage that you can easily see changes in code reviews. But it a * It is problematic to snapshot a lot of data, because it takes up a lot of space in your tests. * Binary data or images are not readable in your tests. -The `outsource(...)` function solves this problem and integrates itself nicely with the inline snapshot. +The `outsource()` function solves this problem and integrates itself nicely with the inline snapshot. It stores the data in a special `external()` object that can be compared in snapshots. The object is represented by the hash of the data. The actual data is stored in a separate file in your project. diff --git a/tests/test_docs.py b/tests/test_docs.py index 5e6e5fab..e59c7fa0 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -37,6 +37,14 @@ def test_docs(project, file, subtests): is_block = False code = None indent = "" + + project.pyproject( + """ +[tool.black] +line-length=80 +""" + ) + for linenumber, line in enumerate(text.splitlines(), start=1): m = block_start.fullmatch(line) if m and is_block == True: