--- /srv/reproducible-results/rbuild-debian/r-b-build.HxKvZz7h/b1/python-inline-snapshot_0.14.0-2_i386.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.HxKvZz7h/b2/python-inline-snapshot_0.14.0-2_i386.changes ├── Files │ @@ -1,3 +1,3 @@ │ │ - 140574b44056b9bcc03a7e56d81de19d 655940 doc optional python-inline-snapshot-doc_0.14.0-2_all.deb │ + fa2cc6a07eb3762aefdbb086570debdf 655944 doc optional python-inline-snapshot-doc_0.14.0-2_all.deb │ 50eecb26435368b0db18a0c41dbfb6b8 28220 python optional python3-inline-snapshot_0.14.0-2_all.deb ├── python-inline-snapshot-doc_0.14.0-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2024-12-04 09:09:58.000000 debian-binary │ │ -rw-r--r-- 0 0 0 3028 2024-12-04 09:09:58.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 652720 2024-12-04 09:09:58.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 652724 2024-12-04 09:09:58.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── ./usr/share/doc/python-inline-snapshot-doc/html/extra.html │ │ │ │ @@ -1032,15 +1032,15 @@ │ │ │ │ print("some error", file=sys.stderr) │ │ │ │

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py │ │ │ │
 61
│ │ │ │   62
│ │ │ │   63
│ │ │ │   64
│ │ │ │   65
│ │ │ │   66
│ │ │ │   67
│ │ │ │ @@ -1245,15 +1245,15 @@
│ │ │ │          1 / 0
│ │ │ │  

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
15
│ │ │ │  16
│ │ │ │  17
│ │ │ │  18
│ │ │ │  19
│ │ │ │  20
│ │ │ │  21
│ │ │ │ ├── html2text {}
│ │ │ │ │ @@ -80,15 +80,15 @@
│ │ │ │ │  def test_prints():
│ │ │ │ │      with prints(
│ │ │ │ │          stdout=IsStr(),
│ │ │ │ │          stderr=snapshot("some error\n"),
│ │ │ │ │      ):
│ │ │ │ │          print("hello world")
│ │ │ │ │          print("some error", file=sys.stderr)
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  extra.py
│ │ │ │ │      @contextlib.contextmanager
│ │ │ │ │  _ _6_1 def prints(*, stdout: Snapshot[str] = "", stderr: Snapshot[str] = ""):
│ │ │ │ │  _ _6_2     """Uses `contextlib.redirect_stderr/stdout` to capture the output and
│ │ │ │ │  _ _6_3     compare it with the snapshots. `dirty_equals.IsStr` can be used to
│ │ │ │ │  _ _6_4 ignore
│ │ │ │ │  _ _6_5     the output if needed.
│ │ │ │ │ @@ -176,15 +176,15 @@
│ │ │ │ │  from inline_snapshot import snapshot
│ │ │ │ │  from inline_snapshot.extra import raises
│ │ │ │ │  
│ │ │ │ │  
│ │ │ │ │  def test_raises():
│ │ │ │ │      with raises(snapshot("ZeroDivisionError: division by zero")):
│ │ │ │ │          1 / 0
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  extra.py
│ │ │ │ │     @contextlib.contextmanager
│ │ │ │ │  _1_5 def raises(exception: Snapshot[str]):
│ │ │ │ │  _1_6     """Check that an exception is raised.
│ │ │ │ │  _1_7
│ │ │ │ │  _1_8     Parameters:
│ │ │ │ │  _1_9         exception: snapshot which is compared with `#!python f"{type}:
│ │ │ ├── ./usr/share/doc/python-inline-snapshot-doc/html/outsource.html
│ │ │ │ @@ -1157,15 +1157,15 @@
│ │ │ │                
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │
136
│ │ │ │  137
│ │ │ │  138
│ │ │ │  139
│ │ │ │  140
│ │ │ │  141
│ │ │ │  142
│ │ │ │ @@ -1273,15 +1273,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │                
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │
 76
│ │ │ │   77
│ │ │ │   78
│ │ │ │   79
│ │ │ │   80
│ │ │ │   81
│ │ │ │   82
│ │ │ │ @@ -1419,15 +1419,15 @@
│ │ │ │  
│ │ │ │      
│ │ │ │ │ │ │ │

Two external objects are equal if they have the same hash and │ │ │ │ suffix.

│ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
115
│ │ │ │  116
│ │ │ │  117
│ │ │ │  118
│ │ │ │  119
│ │ │ │  120
│ │ │ │  121
│ │ │ │ @@ -1504,15 +1504,15 @@
│ │ │ │                  required
│ │ │ │              
│ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │
77
│ │ │ │  78
│ │ │ │  79
│ │ │ │  80
│ │ │ │  81
│ │ │ │  82
│ │ │ │  83
│ │ │ │ @@ -1566,15 +1566,15 @@
│ │ │ │      
│ │ │ │ │ │ │ │

Returns the representation of the external object.

│ │ │ │

The length of the hash can be specified in the │ │ │ │ config.

│ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py │ │ │ │
102
│ │ │ │  103
│ │ │ │  104
│ │ │ │  105
│ │ │ │  106
│ │ │ │  107
│ │ │ │  108
│ │ │ │ ├── html2text {}
│ │ │ │ │ @@ -105,15 +105,15 @@
│ │ │ │ │                           encoded with "utf-8".
│ │ │ │ │                           overwrite file suffix. The default is ".bin"
│ │ │ │ │  suffix Optional[str]     if data is an instance of bytes and ".txt"   None
│ │ │ │ │                           for str.
│ │ │ │ │  Returns:
│ │ │ │ │  TTyyppee     DDeessccrriippttiioonn
│ │ │ │ │  _e_x_t_e_r_n_a_l The external data.
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  _external.py
│ │ │ │ │      def outsource(data: Union[str, bytes], *, suffix: Optional[str] = None) -
│ │ │ │ │      > external:
│ │ │ │ │  _1_3_6     """Outsource some data into an external file.
│ │ │ │ │  _1_3_7
│ │ │ │ │  _1_3_8     ``` pycon
│ │ │ │ │  _1_3_9     >>> png_data = b"some_bytes"  # should be the replaced with your actual
│ │ │ │ │ @@ -157,15 +157,15 @@
│ │ │ │ │  _1_7_7
│ │ │ │ │  _1_7_8     if not storage.lookup_all(name):
│ │ │ │ │  _1_7_9         path = hash + "-new" + suffix
│ │ │ │ │  _1_8_0         storage.save(path, data)
│ │ │ │ │  
│ │ │ │ │          return external(name)
│ │ │ │ │  iinnlliinnee__ssnnaappsshhoott..eexxtteerrnnaall _?¶
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  _external.py
│ │ │ │ │      class external:
│ │ │ │ │          def __init__(self, name: str):
│ │ │ │ │  _ _7_6         """External objects are used as a representation for outsourced
│ │ │ │ │  _ _7_7 data.
│ │ │ │ │  _ _7_8         You should not create them directly.
│ │ │ │ │  _ _7_9
│ │ │ │ │ @@ -224,15 +224,15 @@
│ │ │ │ │  _1_3_2         return True
│ │ │ │ │  _1_3_3
│ │ │ │ │          def _load_value(self):
│ │ │ │ │              assert storage is not None
│ │ │ │ │              return storage.read(self._path)
│ │ │ │ │  ____eeqq____((ootthheerr)) _?¶
│ │ │ │ │  Two external objects are equal if they have the same hash and suffix.
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  _external.py
│ │ │ │ │  _1_1_5 def __eq__(self, other):
│ │ │ │ │  _1_1_6     """Two external objects are equal if they have the same hash and
│ │ │ │ │  _1_1_7     suffix."""
│ │ │ │ │  _1_1_8     if not isinstance(other, external):
│ │ │ │ │  _1_1_9         return NotImplemented
│ │ │ │ │  _1_2_0
│ │ │ │ │ @@ -251,15 +251,15 @@
│ │ │ │ │  The external data is stored inside /.inline_snapshot/
│ │ │ │ │  external, where  is replaced by the directory containing the
│ │ │ │ │  Pytest configuration file, if any. Data which is outsourced but not referenced
│ │ │ │ │  in the source code jet has a '-new' suffix in the filename.
│ │ │ │ │  Parameters:
│ │ │ │ │  NNaammee TTyyppee DDeessccrriippttiioonn                             DDeeffaauulltt
│ │ │ │ │  name str  the name of the external stored object. rreeqquuiirreedd
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  _external.py
│ │ │ │ │     def __init__(self, name: str):
│ │ │ │ │         """External objects are used as a representation for outsourced data.
│ │ │ │ │  _7_7     You should not create them directly.
│ │ │ │ │  _7_8
│ │ │ │ │  _7_9     The external data is stored inside
│ │ │ │ │  _8_0 `/.inline_snapshot/external`,
│ │ │ │ │ @@ -280,15 +280,15 @@
│ │ │ │ │  _9_5         raise ValueError(
│ │ │ │ │  _9_6             "path has to be of the form . or
│ │ │ │ │     *."
│ │ │ │ │             )
│ │ │ │ │  ____rreepprr____(()) _?¶
│ │ │ │ │  Returns the representation of the external object.
│ │ │ │ │  The length of the hash can be specified in the _c_o_n_f_i_g.
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  _external.py
│ │ │ │ │  _1_0_2 def __repr__(self):
│ │ │ │ │  _1_0_3     """Returns the representation of the external object.
│ │ │ │ │  _1_0_4
│ │ │ │ │  _1_0_5     The length of the hash can be specified in the
│ │ │ │ │  _1_0_6     [config](configuration.md).
│ │ │ │ │  _1_0_7     """
│ │ │ ├── ./usr/share/doc/python-inline-snapshot-doc/html/pytest.html
│ │ │ │ @@ -967,16 +967,16 @@
│ │ │ │  def test_something():
│ │ │ │      assert 1 == snapshot()
│ │ │ │      assert 2 <= snapshot(5)
│ │ │ │  
│ │ │ │
> pytest test_something.py --inline-snapshot=create,report
│ │ │ │  ============================= test session starts ==============================
│ │ │ │  platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
│ │ │ │ -rootdir: /tmp/tmp.CETKrEZFtC
│ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0
│ │ │ │ +rootdir: /tmp/tmp.Wt1lijWNCQ
│ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8
│ │ │ │  collected 1 item
│ │ │ │  
│ │ │ │  test_something.py .                                                      [100%]
│ │ │ │  =============================== inline snapshot ================================
│ │ │ │  ─────────────────────────────── Create snapshots ───────────────────────────────
│ │ │ │  +----------------------------- test_something.py ------------------------------+
│ │ │ │  | @@ -2,5 +2,5 @@                                                              |
│ │ │ │ @@ -1001,51 +1001,51 @@
│ │ │ │  | +    assert 2 <= snapshot(2)                                                 |
│ │ │ │  +------------------------------------------------------------------------------+
│ │ │ │  These changes are not applied.
│ │ │ │  Use --inline-snapshot=trim to apply them, or use the interactive mode with 
│ │ │ │  --inline-snapshot=review
│ │ │ │  
│ │ │ │  
│ │ │ │ -============================== 1 passed in 0.16s ===============================
│ │ │ │ +============================== 1 passed in 0.11s ===============================
│ │ │ │  
│ │ │ │

--inline-snapshot=short-report

│ │ │ │

give a short report over which changes can be made to the snapshots

│ │ │ │
> pytest test_something.py --inline-snapshot=short-report
│ │ │ │  ============================= test session starts ==============================
│ │ │ │  platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
│ │ │ │ -rootdir: /tmp/tmp.OH39pszdwB
│ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0
│ │ │ │ +rootdir: /tmp/tmp.78DgZaOzgR
│ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8
│ │ │ │  collected 1 item
│ │ │ │  
│ │ │ │  test_something.py .E                                                     [100%]
│ │ │ │  
│ │ │ │  ==================================== ERRORS ====================================
│ │ │ │  _____________________ ERROR at teardown of test_something ______________________
│ │ │ │  your snapshot is missing one value.
│ │ │ │  =============================== inline snapshot ================================
│ │ │ │  Info: one snapshot can be trimmed (--inline-snapshot=trim)
│ │ │ │  Error: one snapshot is missing a value (--inline-snapshot=create)
│ │ │ │  
│ │ │ │  You can also use --inline-snapshot=review to approve the changes interactively
│ │ │ │  =========================== short test summary info ============================
│ │ │ │  ERROR test_something.py::test_something - Failed: your snapshot is missing one value.
│ │ │ │ -========================== 1 passed, 1 error in 0.16s ==========================
│ │ │ │ +========================== 1 passed, 1 error in 0.13s ==========================
│ │ │ │  
│ │ │ │
│ │ │ │

Info

│ │ │ │

short-report exists mainly to show that snapshots have changed with enabled pytest assert-rewriting. │ │ │ │ This option will be replaced with report when this restriction is lifted.

│ │ │ │
│ │ │ │

--inline-snapshot=report

│ │ │ │

Shows a diff report over which changes can be made to the snapshots

│ │ │ │
> pytest test_something.py --inline-snapshot=report
│ │ │ │  ============================= test session starts ==============================
│ │ │ │  platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
│ │ │ │ -rootdir: /tmp/tmp.uRkCyvpEg8
│ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0
│ │ │ │ +rootdir: /tmp/tmp.BAEOfeFGMp
│ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8
│ │ │ │  collected 1 item
│ │ │ │  
│ │ │ │  test_something.py .E                                                     [100%]
│ │ │ │  
│ │ │ │  ==================================== ERRORS ====================================
│ │ │ │  _____________________ ERROR at teardown of test_something ______________________
│ │ │ │  your snapshot is missing one value.
│ │ │ │ @@ -1077,23 +1077,23 @@
│ │ │ │  +------------------------------------------------------------------------------+
│ │ │ │  These changes are not applied.
│ │ │ │  Use --inline-snapshot=trim to apply them, or use the interactive mode with 
│ │ │ │  --inline-snapshot=review
│ │ │ │  
│ │ │ │  =========================== short test summary info ============================
│ │ │ │  ERROR test_something.py::test_something - Failed: your snapshot is missing one value.
│ │ │ │ -========================== 1 passed, 1 error in 0.18s ==========================
│ │ │ │ +========================== 1 passed, 1 error in 0.21s ==========================
│ │ │ │  
│ │ │ │

--inline-snapshot=review

│ │ │ │

Shows a diff report for each category and ask if you want to apply the changes

│ │ │ │
> pytest test_something.py --inline-snapshot=review
│ │ │ │  ============================= test session starts ==============================
│ │ │ │  platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
│ │ │ │ -rootdir: /tmp/tmp.hpELK540k1
│ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0
│ │ │ │ +rootdir: /tmp/tmp.y5TdogDd7R
│ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8
│ │ │ │  collected 1 item
│ │ │ │  
│ │ │ │  test_something.py .                                                      [100%]
│ │ │ │  =============================== inline snapshot ================================
│ │ │ │  ─────────────────────────────── Create snapshots ───────────────────────────────
│ │ │ │  +----------------------------- test_something.py ------------------------------+
│ │ │ │  | @@ -2,5 +2,5 @@                                                              |
│ │ │ │ @@ -1114,15 +1114,15 @@
│ │ │ │  |  def test_something():                                                       |
│ │ │ │  |      assert 1 == snapshot(1)                                                 |
│ │ │ │  | -    assert 2 <= snapshot(5)                                                 |
│ │ │ │  | +    assert 2 <= snapshot(2)                                                 |
│ │ │ │  +------------------------------------------------------------------------------+
│ │ │ │  do you want to trim these snapshots? [y/n] (n): 
│ │ │ │  
│ │ │ │ -============================== 1 passed in 0.23s ===============================
│ │ │ │ +============================== 1 passed in 0.19s ===============================
│ │ │ │  
│ │ │ │

--inline-snapshot=disable

│ │ │ │

Disables all the snapshot logic. snapshot(x) will just return x. │ │ │ │ This can be used if you think exclude that snapshot logic causes a problem in your tests, or if you want to speedup your CI.

│ │ │ │
│ │ │ │

deprecation

│ │ │ │

This option was previously called --inline-snapshot-disable

│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -66,17 +66,17 @@ │ │ │ │ │ def test_something(): │ │ │ │ │ assert 1 == snapshot() │ │ │ │ │ assert 2 <= snapshot(5) │ │ │ │ │ [1;34m> pytest test_something.py --inline-snapshot=create,report │ │ │ │ │ [0m============================= test session starts │ │ │ │ │ ============================== │ │ │ │ │ platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 │ │ │ │ │ -rootdir: /tmp/tmp.CETKrEZFtC │ │ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time- │ │ │ │ │ -machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0 │ │ │ │ │ +rootdir: /tmp/tmp.Wt1lijWNCQ │ │ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time- │ │ │ │ │ +machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8 │ │ │ │ │ collected 1 item │ │ │ │ │ │ │ │ │ │ test_something.py . │ │ │ │ │ [100%] │ │ │ │ │ =============================== inline snapshot │ │ │ │ │ ================================ │ │ │ │ │ ─────────────────────────────── Create snapshots │ │ │ │ │ @@ -124,25 +124,25 @@ │ │ │ │ │ +------------------------------------------------------------------------------ │ │ │ │ │ + │ │ │ │ │ These changes are not applied. │ │ │ │ │ Use --inline-snapshot=trim to apply them, or use the interactive mode with │ │ │ │ │ --inline-snapshot=review │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -[32m============================== 1 passed in 0.16s │ │ │ │ │ +[32m============================== 1 passed in 0.11s │ │ │ │ │ =============================== │ │ │ │ │ ********** ----iinnlliinnee--ssnnaappsshhoott==sshhoorrtt--rreeppoorrtt_?¶ ********** │ │ │ │ │ give a short report over which changes can be made to the snapshots │ │ │ │ │ [1;34m> pytest test_something.py --inline-snapshot=short-report │ │ │ │ │ [0m============================= test session starts │ │ │ │ │ ============================== │ │ │ │ │ platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 │ │ │ │ │ -rootdir: /tmp/tmp.OH39pszdwB │ │ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time- │ │ │ │ │ -machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0 │ │ │ │ │ +rootdir: /tmp/tmp.78DgZaOzgR │ │ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time- │ │ │ │ │ +machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8 │ │ │ │ │ collected 1 item │ │ │ │ │ │ │ │ │ │ test_something.py .E │ │ │ │ │ [100%] │ │ │ │ │ │ │ │ │ │ ==================================== ERRORS │ │ │ │ │ ==================================== │ │ │ │ │ @@ -156,28 +156,28 @@ │ │ │ │ │ │ │ │ │ │ You can also use --inline-snapshot=review to approve the changes interactively │ │ │ │ │ [36m=========================== short test summary info │ │ │ │ │ ============================ │ │ │ │ │ [31mERROR test_something.py::test_something - Failed: your snapshot │ │ │ │ │ is missing one value. │ │ │ │ │ [31m========================== 1 passed, 1 error in │ │ │ │ │ -0.16s ========================== │ │ │ │ │ +0.13s ========================== │ │ │ │ │ Info │ │ │ │ │ short-report exists mainly to show that snapshots have changed with enabled │ │ │ │ │ pytest assert-rewriting. This option will be replaced with rreeppoorrtt when this │ │ │ │ │ restriction is lifted. │ │ │ │ │ ********** ----iinnlliinnee--ssnnaappsshhoott==rreeppoorrtt_?¶ ********** │ │ │ │ │ Shows a diff report over which changes can be made to the snapshots │ │ │ │ │ [1;34m> pytest test_something.py --inline-snapshot=report │ │ │ │ │ [0m============================= test session starts │ │ │ │ │ ============================== │ │ │ │ │ platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 │ │ │ │ │ -rootdir: /tmp/tmp.uRkCyvpEg8 │ │ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time- │ │ │ │ │ -machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0 │ │ │ │ │ +rootdir: /tmp/tmp.BAEOfeFGMp │ │ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time- │ │ │ │ │ +machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8 │ │ │ │ │ collected 1 item │ │ │ │ │ │ │ │ │ │ test_something.py .E │ │ │ │ │ [100%] │ │ │ │ │ │ │ │ │ │ ==================================== ERRORS │ │ │ │ │ ==================================== │ │ │ │ │ @@ -237,24 +237,24 @@ │ │ │ │ │ --inline-snapshot=review │ │ │ │ │ │ │ │ │ │ [36m=========================== short test summary info │ │ │ │ │ ============================ │ │ │ │ │ [31mERROR test_something.py::test_something - Failed: your snapshot │ │ │ │ │ is missing one value. │ │ │ │ │ [31m========================== 1 passed, 1 error in │ │ │ │ │ -0.18s ========================== │ │ │ │ │ +0.21s ========================== │ │ │ │ │ ********** ----iinnlliinnee--ssnnaappsshhoott==rreevviieeww_?¶ ********** │ │ │ │ │ Shows a diff report for each category and ask if you want to apply the changes │ │ │ │ │ [1;34m> pytest test_something.py --inline-snapshot=review │ │ │ │ │ [0m============================= test session starts │ │ │ │ │ ============================== │ │ │ │ │ platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 │ │ │ │ │ -rootdir: /tmp/tmp.hpELK540k1 │ │ │ │ │ -plugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time- │ │ │ │ │ -machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0 │ │ │ │ │ +rootdir: /tmp/tmp.y5TdogDd7R │ │ │ │ │ +plugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time- │ │ │ │ │ +machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8 │ │ │ │ │ collected 1 item │ │ │ │ │ │ │ │ │ │ test_something.py . │ │ │ │ │ [100%] │ │ │ │ │ =============================== inline snapshot │ │ │ │ │ ================================ │ │ │ │ │ ─────────────────────────────── Create snapshots │ │ │ │ │ @@ -298,15 +298,15 @@ │ │ │ │ │ | │ │ │ │ │ | + assert 2 <= snapshot(2) │ │ │ │ │ | │ │ │ │ │ +------------------------------------------------------------------------------ │ │ │ │ │ + │ │ │ │ │ do you want to trim these snapshots? [y/n] (n): │ │ │ │ │ │ │ │ │ │ -[32m============================== 1 passed in 0.23s │ │ │ │ │ +[32m============================== 1 passed in 0.19s │ │ │ │ │ =============================== │ │ │ │ │ ********** ----iinnlliinnee--ssnnaappsshhoott==ddiissaabbllee_?¶ ********** │ │ │ │ │ Disables all the snapshot logic. snapshot(x) will just return x. This can be │ │ │ │ │ used if you think exclude that snapshot logic causes a problem in your tests, │ │ │ │ │ or if you want to speedup your CI. │ │ │ │ │ deprecation │ │ │ │ │ This option was previously called --inline-snapshot-disable │ │ │ ├── ./usr/share/doc/python-inline-snapshot-doc/html/search/search_index.json │ │ │ │ ├── Pretty-printed │ │ │ │ │┄ Similarity: 0.9965277777777778% │ │ │ │ │┄ Differences: {"'docs'": "{106: {'text': '

Uses contextlib.redirect_stderr/stdout to capture the " │ │ │ │ │┄ 'output and compare it with the snapshots. dirty_equals.IsStr can be used ' │ │ │ │ │┄ 'to ignore the output if needed.

Parameters:

Name Type Description Default ' │ │ │ │ │┄ 'stdout Snapshot[str]

snapshot which is compared to the ' │ │ │ │ │┄ "recorded output

\\'\\' stderr Snapshot[str] " │ │ │ │ │┄ "

The following functions are build on top of inline-snapshot and could also be implemented in an extra library.

They are part of inline-snapshot because they are general useful and do not depend on other libraries.

", │ │ │ │ │ "title": "inline_snapshot.extra" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "extra.html#inline_snapshot.extra.prints", │ │ │ │ │ - "text": "

Uses contextlib.redirect_stderr/stdout to capture the output and compare it with the snapshots. dirty_equals.IsStr can be used to ignore the output if needed.

Parameters:

Name Type Description Default stdout Snapshot[str]

snapshot which is compared to the recorded output

'' stderr Snapshot[str]

snapshot which is compared to the recorded error output

'' original--inline-snapshot=createignore stdout

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import prints\nimport sys\n\n\ndef test_prints():\n    with prints(stdout=snapshot(), stderr=snapshot()):\n        print(\"hello world\")\n        print(\"some error\", file=sys.stderr)\n

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import prints\nimport sys\n\n\ndef test_prints():\n    with prints(\n        stdout=snapshot(\"hello world\\n\"), stderr=snapshot(\"some error\\n\")\n    ):\n        print(\"hello world\")\n        print(\"some error\", file=sys.stderr)\n

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import prints\nfrom dirty_equals import IsStr\nimport sys\n\n\ndef test_prints():\n    with prints(\n        stdout=IsStr(),\n        stderr=snapshot(\"some error\\n\"),\n    ):\n        print(\"hello world\")\n        print(\"some error\", file=sys.stderr)\n

Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py
@contextlib.contextmanager\ndef prints(*, stdout: Snapshot[str] = \"\", stderr: Snapshot[str] = \"\"):\n    \"\"\"Uses `contextlib.redirect_stderr/stdout` to capture the output and\n    compare it with the snapshots. `dirty_equals.IsStr` can be used to ignore\n    the output if needed.\n\n    Parameters:\n        stdout: snapshot which is compared to the recorded output\n        stderr: snapshot which is compared to the recorded error output\n\n    === \"original\"\n\n        <!-- inline-snapshot: first_block outcome-passed=1 outcome-errors=1 -->\n        ``` python\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import prints\n        import sys\n\n\n        def test_prints():\n            with prints(stdout=snapshot(), stderr=snapshot()):\n                print(\"hello world\")\n                print(\"some error\", file=sys.stderr)\n        ```\n\n    === \"--inline-snapshot=create\"\n\n        <!-- inline-snapshot: create outcome-passed=1 -->\n        ``` python hl_lines=\"7 8 9\"\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import prints\n        import sys\n\n\n        def test_prints():\n            with prints(\n                stdout=snapshot(\"hello world\\\\n\"), stderr=snapshot(\"some error\\\\n\")\n            ):\n                print(\"hello world\")\n                print(\"some error\", file=sys.stderr)\n        ```\n\n    === \"ignore stdout\"\n\n        <!-- inline-snapshot: outcome-passed=1 -->\n        ``` python hl_lines=\"3 9 10\"\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import prints\n        from dirty_equals import IsStr\n        import sys\n\n\n        def test_prints():\n            with prints(\n                stdout=IsStr(),\n                stderr=snapshot(\"some error\\\\n\"),\n            ):\n                print(\"hello world\")\n                print(\"some error\", file=sys.stderr)\n        ```\n    \"\"\"\n\n    with redirect_stdout(io.StringIO()) as stdout_io:\n        with redirect_stderr(io.StringIO()) as stderr_io:\n            yield\n\n    assert stderr_io.getvalue() == stderr\n    assert stdout_io.getvalue() == stdout\n
", │ │ │ │ │ + "text": "

Uses contextlib.redirect_stderr/stdout to capture the output and compare it with the snapshots. dirty_equals.IsStr can be used to ignore the output if needed.

Parameters:

Name Type Description Default stdout Snapshot[str]

snapshot which is compared to the recorded output

'' stderr Snapshot[str]

snapshot which is compared to the recorded error output

'' original--inline-snapshot=createignore stdout

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import prints\nimport sys\n\n\ndef test_prints():\n    with prints(stdout=snapshot(), stderr=snapshot()):\n        print(\"hello world\")\n        print(\"some error\", file=sys.stderr)\n

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import prints\nimport sys\n\n\ndef test_prints():\n    with prints(\n        stdout=snapshot(\"hello world\\n\"), stderr=snapshot(\"some error\\n\")\n    ):\n        print(\"hello world\")\n        print(\"some error\", file=sys.stderr)\n

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import prints\nfrom dirty_equals import IsStr\nimport sys\n\n\ndef test_prints():\n    with prints(\n        stdout=IsStr(),\n        stderr=snapshot(\"some error\\n\"),\n    ):\n        print(\"hello world\")\n        print(\"some error\", file=sys.stderr)\n

Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py
@contextlib.contextmanager\ndef prints(*, stdout: Snapshot[str] = \"\", stderr: Snapshot[str] = \"\"):\n    \"\"\"Uses `contextlib.redirect_stderr/stdout` to capture the output and\n    compare it with the snapshots. `dirty_equals.IsStr` can be used to ignore\n    the output if needed.\n\n    Parameters:\n        stdout: snapshot which is compared to the recorded output\n        stderr: snapshot which is compared to the recorded error output\n\n    === \"original\"\n\n        <!-- inline-snapshot: first_block outcome-passed=1 outcome-errors=1 -->\n        ``` python\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import prints\n        import sys\n\n\n        def test_prints():\n            with prints(stdout=snapshot(), stderr=snapshot()):\n                print(\"hello world\")\n                print(\"some error\", file=sys.stderr)\n        ```\n\n    === \"--inline-snapshot=create\"\n\n        <!-- inline-snapshot: create outcome-passed=1 -->\n        ``` python hl_lines=\"7 8 9\"\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import prints\n        import sys\n\n\n        def test_prints():\n            with prints(\n                stdout=snapshot(\"hello world\\\\n\"), stderr=snapshot(\"some error\\\\n\")\n            ):\n                print(\"hello world\")\n                print(\"some error\", file=sys.stderr)\n        ```\n\n    === \"ignore stdout\"\n\n        <!-- inline-snapshot: outcome-passed=1 -->\n        ``` python hl_lines=\"3 9 10\"\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import prints\n        from dirty_equals import IsStr\n        import sys\n\n\n        def test_prints():\n            with prints(\n                stdout=IsStr(),\n                stderr=snapshot(\"some error\\\\n\"),\n            ):\n                print(\"hello world\")\n                print(\"some error\", file=sys.stderr)\n        ```\n    \"\"\"\n\n    with redirect_stdout(io.StringIO()) as stdout_io:\n        with redirect_stderr(io.StringIO()) as stderr_io:\n            yield\n\n    assert stderr_io.getvalue() == stderr\n    assert stdout_io.getvalue() == stdout\n
", │ │ │ │ │ "title": "prints(*, stdout='', stderr='')" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "extra.html#inline_snapshot.extra.raises", │ │ │ │ │ - "text": "

Check that an exception is raised.

Parameters:

Name Type Description Default exception Snapshot[str]

snapshot which is compared with f\"{type}: {message}\" if an exception occured or \"<no exception>\" if no exception was raised.

required original--inline-snapshot=create

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import raises\n\n\ndef test_raises():\n    with raises(snapshot()):\n        1 / 0\n

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import raises\n\n\ndef test_raises():\n    with raises(snapshot(\"ZeroDivisionError: division by zero\")):\n        1 / 0\n

Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py
@contextlib.contextmanager\ndef raises(exception: Snapshot[str]):\n    \"\"\"Check that an exception is raised.\n\n    Parameters:\n        exception: snapshot which is compared with `#!python f\"{type}: {message}\"` if an exception occured or `#!python \"<no exception>\"` if no exception was raised.\n\n    === \"original\"\n\n        <!-- inline-snapshot: first_block outcome-passed=1 outcome-errors=1 -->\n        ``` python\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import raises\n\n\n        def test_raises():\n            with raises(snapshot()):\n                1 / 0\n        ```\n\n    === \"--inline-snapshot=create\"\n\n        <!-- inline-snapshot: create outcome-passed=1 -->\n        ``` python hl_lines=\"6\"\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import raises\n\n\n        def test_raises():\n            with raises(snapshot(\"ZeroDivisionError: division by zero\")):\n                1 / 0\n        ```\n    \"\"\"\n\n    try:\n        yield\n    except Exception as ex:\n        msg = str(ex)\n        if \"\\n\" in msg:\n            assert f\"{type(ex).__name__}:\\n{ex}\" == exception\n        else:\n            assert f\"{type(ex).__name__}: {ex}\" == exception\n    else:\n        assert \"<no exception>\" == exception\n
", │ │ │ │ │ + "text": "

Check that an exception is raised.

Parameters:

Name Type Description Default exception Snapshot[str]

snapshot which is compared with f\"{type}: {message}\" if an exception occured or \"<no exception>\" if no exception was raised.

required original--inline-snapshot=create

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import raises\n\n\ndef test_raises():\n    with raises(snapshot()):\n        1 / 0\n

from inline_snapshot import snapshot\nfrom inline_snapshot.extra import raises\n\n\ndef test_raises():\n    with raises(snapshot(\"ZeroDivisionError: division by zero\")):\n        1 / 0\n

Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py
@contextlib.contextmanager\ndef raises(exception: Snapshot[str]):\n    \"\"\"Check that an exception is raised.\n\n    Parameters:\n        exception: snapshot which is compared with `#!python f\"{type}: {message}\"` if an exception occured or `#!python \"<no exception>\"` if no exception was raised.\n\n    === \"original\"\n\n        <!-- inline-snapshot: first_block outcome-passed=1 outcome-errors=1 -->\n        ``` python\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import raises\n\n\n        def test_raises():\n            with raises(snapshot()):\n                1 / 0\n        ```\n\n    === \"--inline-snapshot=create\"\n\n        <!-- inline-snapshot: create outcome-passed=1 -->\n        ``` python hl_lines=\"6\"\n        from inline_snapshot import snapshot\n        from inline_snapshot.extra import raises\n\n\n        def test_raises():\n            with raises(snapshot(\"ZeroDivisionError: division by zero\")):\n                1 / 0\n        ```\n    \"\"\"\n\n    try:\n        yield\n    except Exception as ex:\n        msg = str(ex)\n        if \"\\n\" in msg:\n            assert f\"{type(ex).__name__}:\\n{ex}\" == exception\n        else:\n            assert f\"{type(ex).__name__}: {ex}\" == exception\n    else:\n        assert \"<no exception>\" == exception\n
", │ │ │ │ │ "title": "raises(exception)" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "getitem_snapshot.html", │ │ │ │ │ "text": "", │ │ │ │ │ "title": "snapshot()[key]" │ │ │ │ │ }, │ │ │ │ │ @@ -612,65 +612,65 @@ │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#api", │ │ │ │ │ "text": "", │ │ │ │ │ "title": "API" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#inline_snapshot.outsource", │ │ │ │ │ - "text": "

Outsource some data into an external file.

>>> png_data = b\"some_bytes\"  # should be the replaced with your actual data\n>>> outsource(png_data, suffix=\".png\")\nexternal(\"212974ed1835*.png\")\n

Parameters:

Name Type Description Default data Union[str, bytes]

data which should be outsourced. strings are encoded with \"utf-8\".

required suffix Optional[str]

overwrite file suffix. The default is \".bin\" if data is an instance of bytes and \".txt\" for str.

None

Returns:

Type Description external

The external data.

Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py
def outsource(data: Union[str, bytes], *, suffix: Optional[str] = None) -> external:\n    \"\"\"Outsource some data into an external file.\n\n    ``` pycon\n    >>> png_data = b\"some_bytes\"  # should be the replaced with your actual data\n    >>> outsource(png_data, suffix=\".png\")\n    external(\"212974ed1835*.png\")\n\n    ```\n\n    Parameters:\n        data: data which should be outsourced. strings are encoded with `\"utf-8\"`.\n\n        suffix: overwrite file suffix. The default is `\".bin\"` if data is an instance of `#!python bytes` and `\".txt\"` for `#!python str`.\n\n    Returns:\n        The external data.\n    \"\"\"\n    if isinstance(data, str):\n        data = data.encode(\"utf-8\")\n        if suffix is None:\n            suffix = \".txt\"\n\n    elif isinstance(data, bytes):\n        if suffix is None:\n            suffix = \".bin\"\n    else:\n        raise TypeError(\"data has to be of type bytes | str\")\n\n    if not suffix or suffix[0] != \".\":\n        raise ValueError(\"suffix has to start with a '.' like '.png'\")\n\n    m = hashlib.sha256()\n    m.update(data)\n    hash = m.hexdigest()\n\n    assert storage is not None\n\n    name = hash + suffix\n\n    if not storage.lookup_all(name):\n        path = hash + \"-new\" + suffix\n        storage.save(path, data)\n\n    return external(name)\n
", │ │ │ │ │ + "text": "

Outsource some data into an external file.

>>> png_data = b\"some_bytes\"  # should be the replaced with your actual data\n>>> outsource(png_data, suffix=\".png\")\nexternal(\"212974ed1835*.png\")\n

Parameters:

Name Type Description Default data Union[str, bytes]

data which should be outsourced. strings are encoded with \"utf-8\".

required suffix Optional[str]

overwrite file suffix. The default is \".bin\" if data is an instance of bytes and \".txt\" for str.

None

Returns:

Type Description external

The external data.

Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py
def outsource(data: Union[str, bytes], *, suffix: Optional[str] = None) -> external:\n    \"\"\"Outsource some data into an external file.\n\n    ``` pycon\n    >>> png_data = b\"some_bytes\"  # should be the replaced with your actual data\n    >>> outsource(png_data, suffix=\".png\")\n    external(\"212974ed1835*.png\")\n\n    ```\n\n    Parameters:\n        data: data which should be outsourced. strings are encoded with `\"utf-8\"`.\n\n        suffix: overwrite file suffix. The default is `\".bin\"` if data is an instance of `#!python bytes` and `\".txt\"` for `#!python str`.\n\n    Returns:\n        The external data.\n    \"\"\"\n    if isinstance(data, str):\n        data = data.encode(\"utf-8\")\n        if suffix is None:\n            suffix = \".txt\"\n\n    elif isinstance(data, bytes):\n        if suffix is None:\n            suffix = \".bin\"\n    else:\n        raise TypeError(\"data has to be of type bytes | str\")\n\n    if not suffix or suffix[0] != \".\":\n        raise ValueError(\"suffix has to start with a '.' like '.png'\")\n\n    m = hashlib.sha256()\n    m.update(data)\n    hash = m.hexdigest()\n\n    assert storage is not None\n\n    name = hash + suffix\n\n    if not storage.lookup_all(name):\n        path = hash + \"-new\" + suffix\n        storage.save(path, data)\n\n    return external(name)\n
", │ │ │ │ │ "title": "inline_snapshot.outsource(data, *, suffix=None)" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#inline_snapshot.external", │ │ │ │ │ - "text": "Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py
class external:\n    def __init__(self, name: str):\n        \"\"\"External objects are used as a representation for outsourced data.\n        You should not create them directly.\n\n        The external data is stored inside `<pytest_config_dir>/.inline_snapshot/external`,\n        where `<pytest_config_dir>` is replaced by the directory containing the Pytest configuration file, if any.\n        Data which is outsourced but not referenced in the source code jet has a '-new' suffix in the filename.\n\n        Parameters:\n            name: the name of the external stored object.\n        \"\"\"\n\n        m = re.fullmatch(r\"([0-9a-fA-F]*)\\*?(\\.[a-zA-Z0-9]*)\", name)\n\n        if m:\n            self._hash, self._suffix = m.groups()\n        else:\n            raise ValueError(\n                \"path has to be of the form <hash>.<suffix> or <partial_hash>*.<suffix>\"\n            )\n\n    @property\n    def _path(self):\n        return f\"{self._hash}*{self._suffix}\"\n\n    def __repr__(self):\n        \"\"\"Returns the representation of the external object.\n\n        The length of the hash can be specified in the\n        [config](configuration.md).\n        \"\"\"\n        hash = self._hash[: _config.config.hash_length]\n\n        if len(hash) == 64:\n            return f'external(\"{hash}{self._suffix}\")'\n        else:\n            return f'external(\"{hash}*{self._suffix}\")'\n\n    def __eq__(self, other):\n        \"\"\"Two external objects are equal if they have the same hash and\n        suffix.\"\"\"\n        if not isinstance(other, external):\n            return NotImplemented\n\n        min_hash_len = min(len(self._hash), len(other._hash))\n\n        if self._hash[:min_hash_len] != other._hash[:min_hash_len]:\n            return False\n\n        if self._suffix != other._suffix:\n            return False\n\n        return True\n\n    def _load_value(self):\n        assert storage is not None\n        return storage.read(self._path)\n
", │ │ │ │ │ + "text": "Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py
class external:\n    def __init__(self, name: str):\n        \"\"\"External objects are used as a representation for outsourced data.\n        You should not create them directly.\n\n        The external data is stored inside `<pytest_config_dir>/.inline_snapshot/external`,\n        where `<pytest_config_dir>` is replaced by the directory containing the Pytest configuration file, if any.\n        Data which is outsourced but not referenced in the source code jet has a '-new' suffix in the filename.\n\n        Parameters:\n            name: the name of the external stored object.\n        \"\"\"\n\n        m = re.fullmatch(r\"([0-9a-fA-F]*)\\*?(\\.[a-zA-Z0-9]*)\", name)\n\n        if m:\n            self._hash, self._suffix = m.groups()\n        else:\n            raise ValueError(\n                \"path has to be of the form <hash>.<suffix> or <partial_hash>*.<suffix>\"\n            )\n\n    @property\n    def _path(self):\n        return f\"{self._hash}*{self._suffix}\"\n\n    def __repr__(self):\n        \"\"\"Returns the representation of the external object.\n\n        The length of the hash can be specified in the\n        [config](configuration.md).\n        \"\"\"\n        hash = self._hash[: _config.config.hash_length]\n\n        if len(hash) == 64:\n            return f'external(\"{hash}{self._suffix}\")'\n        else:\n            return f'external(\"{hash}*{self._suffix}\")'\n\n    def __eq__(self, other):\n        \"\"\"Two external objects are equal if they have the same hash and\n        suffix.\"\"\"\n        if not isinstance(other, external):\n            return NotImplemented\n\n        min_hash_len = min(len(self._hash), len(other._hash))\n\n        if self._hash[:min_hash_len] != other._hash[:min_hash_len]:\n            return False\n\n        if self._suffix != other._suffix:\n            return False\n\n        return True\n\n    def _load_value(self):\n        assert storage is not None\n        return storage.read(self._path)\n
", │ │ │ │ │ "title": "inline_snapshot.external" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#inline_snapshot.external.__eq__", │ │ │ │ │ - "text": "

Two external objects are equal if they have the same hash and suffix.

Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py
def __eq__(self, other):\n    \"\"\"Two external objects are equal if they have the same hash and\n    suffix.\"\"\"\n    if not isinstance(other, external):\n        return NotImplemented\n\n    min_hash_len = min(len(self._hash), len(other._hash))\n\n    if self._hash[:min_hash_len] != other._hash[:min_hash_len]:\n        return False\n\n    if self._suffix != other._suffix:\n        return False\n\n    return True\n
", │ │ │ │ │ + "text": "

Two external objects are equal if they have the same hash and suffix.

Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py
def __eq__(self, other):\n    \"\"\"Two external objects are equal if they have the same hash and\n    suffix.\"\"\"\n    if not isinstance(other, external):\n        return NotImplemented\n\n    min_hash_len = min(len(self._hash), len(other._hash))\n\n    if self._hash[:min_hash_len] != other._hash[:min_hash_len]:\n        return False\n\n    if self._suffix != other._suffix:\n        return False\n\n    return True\n
", │ │ │ │ │ "title": "__eq__(other)" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#inline_snapshot.external.__init__", │ │ │ │ │ - "text": "

External objects are used as a representation for outsourced data. You should not create them directly.

The external data is stored inside <pytest_config_dir>/.inline_snapshot/external, where <pytest_config_dir> is replaced by the directory containing the Pytest configuration file, if any. Data which is outsourced but not referenced in the source code jet has a '-new' suffix in the filename.

Parameters:

Name Type Description Default name str

the name of the external stored object.

required Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py
def __init__(self, name: str):\n    \"\"\"External objects are used as a representation for outsourced data.\n    You should not create them directly.\n\n    The external data is stored inside `<pytest_config_dir>/.inline_snapshot/external`,\n    where `<pytest_config_dir>` is replaced by the directory containing the Pytest configuration file, if any.\n    Data which is outsourced but not referenced in the source code jet has a '-new' suffix in the filename.\n\n    Parameters:\n        name: the name of the external stored object.\n    \"\"\"\n\n    m = re.fullmatch(r\"([0-9a-fA-F]*)\\*?(\\.[a-zA-Z0-9]*)\", name)\n\n    if m:\n        self._hash, self._suffix = m.groups()\n    else:\n        raise ValueError(\n            \"path has to be of the form <hash>.<suffix> or <partial_hash>*.<suffix>\"\n        )\n
", │ │ │ │ │ + "text": "

External objects are used as a representation for outsourced data. You should not create them directly.

The external data is stored inside <pytest_config_dir>/.inline_snapshot/external, where <pytest_config_dir> is replaced by the directory containing the Pytest configuration file, if any. Data which is outsourced but not referenced in the source code jet has a '-new' suffix in the filename.

Parameters:

Name Type Description Default name str

the name of the external stored object.

required Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py
def __init__(self, name: str):\n    \"\"\"External objects are used as a representation for outsourced data.\n    You should not create them directly.\n\n    The external data is stored inside `<pytest_config_dir>/.inline_snapshot/external`,\n    where `<pytest_config_dir>` is replaced by the directory containing the Pytest configuration file, if any.\n    Data which is outsourced but not referenced in the source code jet has a '-new' suffix in the filename.\n\n    Parameters:\n        name: the name of the external stored object.\n    \"\"\"\n\n    m = re.fullmatch(r\"([0-9a-fA-F]*)\\*?(\\.[a-zA-Z0-9]*)\", name)\n\n    if m:\n        self._hash, self._suffix = m.groups()\n    else:\n        raise ValueError(\n            \"path has to be of the form <hash>.<suffix> or <partial_hash>*.<suffix>\"\n        )\n
", │ │ │ │ │ "title": "__init__(name)" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#inline_snapshot.external.__repr__", │ │ │ │ │ - "text": "

Returns the representation of the external object.

The length of the hash can be specified in the config.

Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py
def __repr__(self):\n    \"\"\"Returns the representation of the external object.\n\n    The length of the hash can be specified in the\n    [config](configuration.md).\n    \"\"\"\n    hash = self._hash[: _config.config.hash_length]\n\n    if len(hash) == 64:\n        return f'external(\"{hash}{self._suffix}\")'\n    else:\n        return f'external(\"{hash}*{self._suffix}\")'\n
", │ │ │ │ │ + "text": "

Returns the representation of the external object.

The length of the hash can be specified in the config.

Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py
def __repr__(self):\n    \"\"\"Returns the representation of the external object.\n\n    The length of the hash can be specified in the\n    [config](configuration.md).\n    \"\"\"\n    hash = self._hash[: _config.config.hash_length]\n\n    if len(hash) == 64:\n        return f'external(\"{hash}{self._suffix}\")'\n    else:\n        return f'external(\"{hash}*{self._suffix}\")'\n
", │ │ │ │ │ "title": "__repr__()" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "outsource.html#pytest-options", │ │ │ │ │ "text": "

It interacts with the following --inline-snapshot flags:

  • trim removes every snapshots form the storage which is not referenced with external(...) in the code.
", │ │ │ │ │ "title": "pytest options" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "pytest.html", │ │ │ │ │ "text": "

inline-snapshot provides one pytest option with different flags (create, fix, trim, update, short-report, report, disable).

Snapshot comparisons return always True if you use one of the flags create, fix or review. This is necessary because the whole test needs to be run to fix all snapshots like in this case:

from inline_snapshot import snapshot\n\n\ndef test_something():\n    assert 1 == snapshot(5)\n    assert 2 <= snapshot(5)\n

Note

Every flag with the exception of disable and short-report disables the pytest assert-rewriting.

", │ │ │ │ │ "title": "pytest integration" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "pytest.html#-inline-snapshotcreatefixtrimupdate", │ │ │ │ │ - "text": "

Approve the changes of the given category. These flags can be combined with report and review.

test_something.py
from inline_snapshot import snapshot\n\n\ndef test_something():\n    assert 1 == snapshot()\n    assert 2 <= snapshot(5)\n
\u001b[1;34m> pytest test_something.py --inline-snapshot=create,report\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.CETKrEZFtC\nplugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[32m                                                      [100%]\u001b[0m\n=============================== inline snapshot ================================\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Create snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -2,5 +2,5 @@                                                              |\n|                                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n| -    assert 1 == snapshot()                                                  |\n| +    assert 1 == snapshot(1)                                                 |\n|      assert 2 <= snapshot(5)                                                 |\n+------------------------------------------------------------------------------+\nThese changes will be applied, because you used --inline-snapshot=create\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Trim snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -3,4 +3,4 @@                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n|      assert 1 == snapshot(1)                                                 |\n| -    assert 2 <= snapshot(5)                                                 |\n| +    assert 2 <= snapshot(2)                                                 |\n+------------------------------------------------------------------------------+\nThese changes are not applied.\nUse --inline-snapshot=trim to apply them, or use the interactive mode with \n--inline-snapshot=review\n\n\n\u001b[32m============================== \u001b[32m\u001b[1m1 passed\u001b[0m\u001b[32m in 0.16s\u001b[0m\u001b[32m ===============================\u001b[0m\n
", │ │ │ │ │ + "text": "

Approve the changes of the given category. These flags can be combined with report and review.

test_something.py
from inline_snapshot import snapshot\n\n\ndef test_something():\n    assert 1 == snapshot()\n    assert 2 <= snapshot(5)\n
\u001b[1;34m> pytest test_something.py --inline-snapshot=create,report\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.Wt1lijWNCQ\nplugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[32m                                                      [100%]\u001b[0m\n=============================== inline snapshot ================================\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Create snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -2,5 +2,5 @@                                                              |\n|                                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n| -    assert 1 == snapshot()                                                  |\n| +    assert 1 == snapshot(1)                                                 |\n|      assert 2 <= snapshot(5)                                                 |\n+------------------------------------------------------------------------------+\nThese changes will be applied, because you used --inline-snapshot=create\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Trim snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -3,4 +3,4 @@                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n|      assert 1 == snapshot(1)                                                 |\n| -    assert 2 <= snapshot(5)                                                 |\n| +    assert 2 <= snapshot(2)                                                 |\n+------------------------------------------------------------------------------+\nThese changes are not applied.\nUse --inline-snapshot=trim to apply them, or use the interactive mode with \n--inline-snapshot=review\n\n\n\u001b[32m============================== \u001b[32m\u001b[1m1 passed\u001b[0m\u001b[32m in 0.11s\u001b[0m\u001b[32m ===============================\u001b[0m\n
", │ │ │ │ │ "title": "--inline-snapshot=create,fix,trim,update" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "pytest.html#-inline-snapshotshort-report", │ │ │ │ │ - "text": "

give a short report over which changes can be made to the snapshots

\u001b[1;34m> pytest test_something.py --inline-snapshot=short-report\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.OH39pszdwB\nplugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m                                                     [100%]\u001b[0m\n\n==================================== ERRORS ====================================\n\u001b[31m\u001b[1m_____________________ ERROR at teardown of test_something ______________________\u001b[0m\n\u001b[0myour snapshot \u001b[95mis\u001b[39;49;00m missing one value.\u001b[90m\u001b[39;49;00m\n=============================== inline snapshot ================================\nInfo: one snapshot can be trimmed (--inline-snapshot=trim)\nError: one snapshot is missing a value (--inline-snapshot=create)\n\nYou can also use --inline-snapshot=review to approve the changes interactively\n\u001b[36m\u001b[1m=========================== short test summary info ============================\u001b[0m\n\u001b[31mERROR\u001b[0m test_something.py::\u001b[1mtest_something\u001b[0m - Failed: your snapshot is missing one value.\n\u001b[31m========================== \u001b[32m1 passed\u001b[0m, \u001b[31m\u001b[1m1 error\u001b[0m\u001b[31m in 0.16s\u001b[0m\u001b[31m ==========================\u001b[0m\n

Info

short-report exists mainly to show that snapshots have changed with enabled pytest assert-rewriting. This option will be replaced with report when this restriction is lifted.

", │ │ │ │ │ + "text": "

give a short report over which changes can be made to the snapshots

\u001b[1;34m> pytest test_something.py --inline-snapshot=short-report\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.78DgZaOzgR\nplugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m                                                     [100%]\u001b[0m\n\n==================================== ERRORS ====================================\n\u001b[31m\u001b[1m_____________________ ERROR at teardown of test_something ______________________\u001b[0m\n\u001b[0myour snapshot \u001b[95mis\u001b[39;49;00m missing one value.\u001b[90m\u001b[39;49;00m\n=============================== inline snapshot ================================\nInfo: one snapshot can be trimmed (--inline-snapshot=trim)\nError: one snapshot is missing a value (--inline-snapshot=create)\n\nYou can also use --inline-snapshot=review to approve the changes interactively\n\u001b[36m\u001b[1m=========================== short test summary info ============================\u001b[0m\n\u001b[31mERROR\u001b[0m test_something.py::\u001b[1mtest_something\u001b[0m - Failed: your snapshot is missing one value.\n\u001b[31m========================== \u001b[32m1 passed\u001b[0m, \u001b[31m\u001b[1m1 error\u001b[0m\u001b[31m in 0.13s\u001b[0m\u001b[31m ==========================\u001b[0m\n

Info

short-report exists mainly to show that snapshots have changed with enabled pytest assert-rewriting. This option will be replaced with report when this restriction is lifted.

", │ │ │ │ │ "title": "--inline-snapshot=short-report" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "pytest.html#-inline-snapshotreport", │ │ │ │ │ - "text": "

Shows a diff report over which changes can be made to the snapshots

\u001b[1;34m> pytest test_something.py --inline-snapshot=report\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.uRkCyvpEg8\nplugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m                                                     [100%]\u001b[0m\n\n==================================== ERRORS ====================================\n\u001b[31m\u001b[1m_____________________ ERROR at teardown of test_something ______________________\u001b[0m\n\u001b[0myour snapshot \u001b[95mis\u001b[39;49;00m missing one value.\u001b[90m\u001b[39;49;00m\n=============================== inline snapshot ================================\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Create snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -2,5 +2,5 @@                                                              |\n|                                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n| -    assert 1 == snapshot()                                                  |\n| +    assert 1 == snapshot(1)                                                 |\n|      assert 2 <= snapshot(5)                                                 |\n+------------------------------------------------------------------------------+\nThese changes are not applied.\nUse --inline-snapshot=create to apply them, or use the interactive mode with \n--inline-snapshot=review\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Trim snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -3,4 +3,4 @@                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n|      assert 1 == snapshot()                                                  |\n| -    assert 2 <= snapshot(5)                                                 |\n| +    assert 2 <= snapshot(2)                                                 |\n+------------------------------------------------------------------------------+\nThese changes are not applied.\nUse --inline-snapshot=trim to apply them, or use the interactive mode with \n--inline-snapshot=review\n\n\u001b[36m\u001b[1m=========================== short test summary info ============================\u001b[0m\n\u001b[31mERROR\u001b[0m test_something.py::\u001b[1mtest_something\u001b[0m - Failed: your snapshot is missing one value.\n\u001b[31m========================== \u001b[32m1 passed\u001b[0m, \u001b[31m\u001b[1m1 error\u001b[0m\u001b[31m in 0.18s\u001b[0m\u001b[31m ==========================\u001b[0m\n
", │ │ │ │ │ + "text": "

Shows a diff report over which changes can be made to the snapshots

\u001b[1;34m> pytest test_something.py --inline-snapshot=report\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.BAEOfeFGMp\nplugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m                                                     [100%]\u001b[0m\n\n==================================== ERRORS ====================================\n\u001b[31m\u001b[1m_____________________ ERROR at teardown of test_something ______________________\u001b[0m\n\u001b[0myour snapshot \u001b[95mis\u001b[39;49;00m missing one value.\u001b[90m\u001b[39;49;00m\n=============================== inline snapshot ================================\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Create snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -2,5 +2,5 @@                                                              |\n|                                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n| -    assert 1 == snapshot()                                                  |\n| +    assert 1 == snapshot(1)                                                 |\n|      assert 2 <= snapshot(5)                                                 |\n+------------------------------------------------------------------------------+\nThese changes are not applied.\nUse --inline-snapshot=create to apply them, or use the interactive mode with \n--inline-snapshot=review\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Trim snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -3,4 +3,4 @@                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n|      assert 1 == snapshot()                                                  |\n| -    assert 2 <= snapshot(5)                                                 |\n| +    assert 2 <= snapshot(2)                                                 |\n+------------------------------------------------------------------------------+\nThese changes are not applied.\nUse --inline-snapshot=trim to apply them, or use the interactive mode with \n--inline-snapshot=review\n\n\u001b[36m\u001b[1m=========================== short test summary info ============================\u001b[0m\n\u001b[31mERROR\u001b[0m test_something.py::\u001b[1mtest_something\u001b[0m - Failed: your snapshot is missing one value.\n\u001b[31m========================== \u001b[32m1 passed\u001b[0m, \u001b[31m\u001b[1m1 error\u001b[0m\u001b[31m in 0.21s\u001b[0m\u001b[31m ==========================\u001b[0m\n
", │ │ │ │ │ "title": "--inline-snapshot=report" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "pytest.html#-inline-snapshotreview", │ │ │ │ │ - "text": "

Shows a diff report for each category and ask if you want to apply the changes

\u001b[1;34m> pytest test_something.py --inline-snapshot=review\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.hpELK540k1\nplugins: pytest_freezer-0.4.8, hypothesis-6.122.1, typeguard-4.4.1, time-machine-2.14.1, subtests-0.13.1, inline-snapshot-0.14.0\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[32m                                                      [100%]\u001b[0m\n=============================== inline snapshot ================================\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Create snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -2,5 +2,5 @@                                                              |\n|                                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n| -    assert 1 == snapshot()                                                  |\n| +    assert 1 == snapshot(1)                                                 |\n|      assert 2 <= snapshot(5)                                                 |\n+------------------------------------------------------------------------------+\ndo you want to create these snapshots? [y/n] (n): \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Trim snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -3,4 +3,4 @@                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n|      assert 1 == snapshot(1)                                                 |\n| -    assert 2 <= snapshot(5)                                                 |\n| +    assert 2 <= snapshot(2)                                                 |\n+------------------------------------------------------------------------------+\ndo you want to trim these snapshots? [y/n] (n): \n\n\u001b[32m============================== \u001b[32m\u001b[1m1 passed\u001b[0m\u001b[32m in 0.23s\u001b[0m\u001b[32m ===============================\u001b[0m\n
", │ │ │ │ │ + "text": "

Shows a diff report for each category and ask if you want to apply the changes

\u001b[1;34m> pytest test_something.py --inline-snapshot=review\n\u001b[0m\u001b[1m============================= test session starts ==============================\u001b[0m\nplatform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0\nrootdir: /tmp/tmp.y5TdogDd7R\nplugins: hypothesis-6.122.1, typeguard-4.4.1, inline-snapshot-0.14.0, time-machine-2.14.1, subtests-0.13.1, pytest_freezer-0.4.8\ncollected 1 item\n\ntest_something.py \u001b[32m.\u001b[0m\u001b[32m                                                      [100%]\u001b[0m\n=============================== inline snapshot ================================\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Create snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -2,5 +2,5 @@                                                              |\n|                                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n| -    assert 1 == snapshot()                                                  |\n| +    assert 1 == snapshot(1)                                                 |\n|      assert 2 <= snapshot(5)                                                 |\n+------------------------------------------------------------------------------+\ndo you want to create these snapshots? [y/n] (n): \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Trim snapshots \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n+----------------------------- test_something.py ------------------------------+\n| @@ -3,4 +3,4 @@                                                              |\n|                                                                              |\n|                                                                              |\n|  def test_something():                                                       |\n|      assert 1 == snapshot(1)                                                 |\n| -    assert 2 <= snapshot(5)                                                 |\n| +    assert 2 <= snapshot(2)                                                 |\n+------------------------------------------------------------------------------+\ndo you want to trim these snapshots? [y/n] (n): \n\n\u001b[32m============================== \u001b[32m\u001b[1m1 passed\u001b[0m\u001b[32m in 0.19s\u001b[0m\u001b[32m ===============================\u001b[0m\n
", │ │ │ │ │ "title": "--inline-snapshot=review" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "pytest.html#-inline-snapshotdisable", │ │ │ │ │ "text": "

Disables all the snapshot logic. snapshot(x) will just return x. This can be used if you think exclude that snapshot logic causes a problem in your tests, or if you want to speedup your CI.

deprecation

This option was previously called --inline-snapshot-disable

", │ │ │ │ │ "title": "--inline-snapshot=disable" │ │ │ │ │ }, │ │ │ │ │ @@ -722,12 +722,12 @@ │ │ │ │ │ { │ │ │ │ │ "location": "types.html#inline_snapshot.Category", │ │ │ │ │ "text": "

See categories

", │ │ │ │ │ "title": "Category = Literal['update', 'fix', 'create', 'trim'] module-attribute" │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "location": "types.html#inline_snapshot.Snapshot", │ │ │ │ │ - "text": "

Can be used to annotate function arguments which accept snapshot values.

You can annotate function arguments with Snapshot[T] to declare that a snapshot-value can be passed as function argument. Snapshot[T] is a type alias for T, which allows you to pass int values instead of int snapshots.

Example:

from typing import Optional\nfrom inline_snapshot import snapshot, Snapshot\n\n# required snapshots\n\n\ndef check_in_bounds(value, lower: Snapshot[int], upper: Snapshot[int]):\n    assert lower <= value <= upper\n\n\ndef test_numbers():\n    for c in \"hello world\":\n        check_in_bounds(ord(c), snapshot(32), snapshot(119))\n\n    # use with normal values\n    check_in_bounds(5, 0, 10)\n\n\n# optional snapshots\n\n\ndef check_container(\n    value,\n    *,\n    value_repr: Optional[Snapshot[str]] = None,\n    length: Optional[Snapshot[int]] = None\n):\n    if value_repr is not None:\n        assert repr(value) == value_repr\n\n    if length is not None:\n        assert len(value) == length\n\n\ndef test_container():\n    check_container([1, 2], value_repr=snapshot(\"[1, 2]\"), length=snapshot(2))\n\n    check_container({1, 1}, length=snapshot(1))\n
Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_types.py
class Snapshot(Generic[T]):\n    \"\"\"Can be used to annotate function arguments which accept snapshot\n    values.\n\n    You can annotate function arguments with `Snapshot[T]` to declare that a snapshot-value can be passed as function argument.\n    `Snapshot[T]` is a type alias for `T`, which allows you to pass `int` values instead of `int` snapshots.\n\n\n    Example:\n    <!-- inline-snapshot: create fix trim first_block outcome-passed=2 -->\n    ``` python\n    from typing import Optional\n    from inline_snapshot import snapshot, Snapshot\n\n    # required snapshots\n\n\n    def check_in_bounds(value, lower: Snapshot[int], upper: Snapshot[int]):\n        assert lower <= value <= upper\n\n\n    def test_numbers():\n        for c in \"hello world\":\n            check_in_bounds(ord(c), snapshot(32), snapshot(119))\n\n        # use with normal values\n        check_in_bounds(5, 0, 10)\n\n\n    # optional snapshots\n\n\n    def check_container(\n        value,\n        *,\n        value_repr: Optional[Snapshot[str]] = None,\n        length: Optional[Snapshot[int]] = None\n    ):\n        if value_repr is not None:\n            assert repr(value) == value_repr\n\n        if length is not None:\n            assert len(value) == length\n\n\n    def test_container():\n        check_container([1, 2], value_repr=snapshot(\"[1, 2]\"), length=snapshot(2))\n\n        check_container({1, 1}, length=snapshot(1))\n    ```\n    \"\"\"\n
", │ │ │ │ │ + "text": "

Can be used to annotate function arguments which accept snapshot values.

You can annotate function arguments with Snapshot[T] to declare that a snapshot-value can be passed as function argument. Snapshot[T] is a type alias for T, which allows you to pass int values instead of int snapshots.

Example:

from typing import Optional\nfrom inline_snapshot import snapshot, Snapshot\n\n# required snapshots\n\n\ndef check_in_bounds(value, lower: Snapshot[int], upper: Snapshot[int]):\n    assert lower <= value <= upper\n\n\ndef test_numbers():\n    for c in \"hello world\":\n        check_in_bounds(ord(c), snapshot(32), snapshot(119))\n\n    # use with normal values\n    check_in_bounds(5, 0, 10)\n\n\n# optional snapshots\n\n\ndef check_container(\n    value,\n    *,\n    value_repr: Optional[Snapshot[str]] = None,\n    length: Optional[Snapshot[int]] = None\n):\n    if value_repr is not None:\n        assert repr(value) == value_repr\n\n    if length is not None:\n        assert len(value) == length\n\n\ndef test_container():\n    check_container([1, 2], value_repr=snapshot(\"[1, 2]\"), length=snapshot(2))\n\n    check_container({1, 1}, length=snapshot(1))\n
Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_types.py
class Snapshot(Generic[T]):\n    \"\"\"Can be used to annotate function arguments which accept snapshot\n    values.\n\n    You can annotate function arguments with `Snapshot[T]` to declare that a snapshot-value can be passed as function argument.\n    `Snapshot[T]` is a type alias for `T`, which allows you to pass `int` values instead of `int` snapshots.\n\n\n    Example:\n    <!-- inline-snapshot: create fix trim first_block outcome-passed=2 -->\n    ``` python\n    from typing import Optional\n    from inline_snapshot import snapshot, Snapshot\n\n    # required snapshots\n\n\n    def check_in_bounds(value, lower: Snapshot[int], upper: Snapshot[int]):\n        assert lower <= value <= upper\n\n\n    def test_numbers():\n        for c in \"hello world\":\n            check_in_bounds(ord(c), snapshot(32), snapshot(119))\n\n        # use with normal values\n        check_in_bounds(5, 0, 10)\n\n\n    # optional snapshots\n\n\n    def check_container(\n        value,\n        *,\n        value_repr: Optional[Snapshot[str]] = None,\n        length: Optional[Snapshot[int]] = None\n    ):\n        if value_repr is not None:\n            assert repr(value) == value_repr\n\n        if length is not None:\n            assert len(value) == length\n\n\n    def test_container():\n        check_container([1, 2], value_repr=snapshot(\"[1, 2]\"), length=snapshot(2))\n\n        check_container({1, 1}, length=snapshot(1))\n    ```\n    \"\"\"\n
", │ │ │ │ │ "title": "Snapshot" │ │ │ │ │ } │ │ │ │ │ ] │ │ │ │ │ } │ │ │ ├── ./usr/share/doc/python-inline-snapshot-doc/html/types.html │ │ │ │ @@ -1001,15 +1001,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ - Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_types.py │ │ │ │ + Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_types.py │ │ │ │
21
│ │ │ │  22
│ │ │ │  23
│ │ │ │  24
│ │ │ │  25
│ │ │ │  26
│ │ │ │  27
│ │ │ │ ├── html2text {}
│ │ │ │ │ @@ -78,15 +78,15 @@
│ │ │ │ │          assert len(value) == length
│ │ │ │ │  
│ │ │ │ │  
│ │ │ │ │  def test_container():
│ │ │ │ │      check_container([1, 2], value_repr=snapshot("[1, 2]"), length=snapshot(2))
│ │ │ │ │  
│ │ │ │ │      check_container({1, 1}, length=snapshot(1))
│ │ │ │ │ -Source code in .pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/
│ │ │ │ │ +Source code in .pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
│ │ │ │ │  _types.py
│ │ │ │ │     class Snapshot(Generic[T]):
│ │ │ │ │  _2_1     """Can be used to annotate function arguments which accept snapshot
│ │ │ │ │  _2_2     values.
│ │ │ │ │  _2_3
│ │ │ │ │  _2_4     You can annotate function arguments with `Snapshot[T]` to declare that a
│ │ │ │ │  _2_5 snapshot-value can be passed as function argument.