110 KB
/srv/reproducible-results/rbuild-debian/r-b-build.SP5VAzxQ/b1/python-inline-snapshot_0.18.1-1_i386.changes vs.
/srv/reproducible-results/rbuild-debian/r-b-build.SP5VAzxQ/b2/python-inline-snapshot_0.18.1-1_i386.changes
324 B
Files
    
Offset 1, 3 lines modifiedOffset 1, 3 lines modified
  
1 ·80b551c46477326ee91c83246d4893c5·665972·doc·optional·python-inline-snapshot-doc_0.18.1-1_all.deb1 ·f3acc5f87244f0fb6d130bf85908212e·665968·doc·optional·python-inline-snapshot-doc_0.18.1-1_all.deb
2 ·88f8e4b1e7193712bfd4842f70c2d2e2·35008·python·optional·python3-inline-snapshot_0.18.1-1_all.deb2 ·88f8e4b1e7193712bfd4842f70c2d2e2·35008·python·optional·python3-inline-snapshot_0.18.1-1_all.deb
110 KB
python-inline-snapshot-doc_0.18.1-1_all.deb
367 B
file list
    
Offset 1, 3 lines modifiedOffset 1, 3 lines modified
1 -rw-r--r--···0········0········0········4·2024-12-28·13:40:37.000000·debian-binary1 -rw-r--r--···0········0········0········4·2024-12-28·13:40:37.000000·debian-binary
2 -rw-r--r--···0········0········0·····3028·2024-12-28·13:40:37.000000·control.tar.xz2 -rw-r--r--···0········0········0·····3028·2024-12-28·13:40:37.000000·control.tar.xz
3 -rw-r--r--···0········0········0···662752·2024-12-28·13:40:37.000000·data.tar.xz3 -rw-r--r--···0········0········0···662748·2024-12-28·13:40:37.000000·data.tar.xz
98.0 B
control.tar.xz
70.0 B
control.tar
48.0 B
./md5sums
30.0 B
./md5sums
Files differ
109 KB
data.tar.xz
109 KB
data.tar
5.55 KB
./usr/share/doc/python-inline-snapshot-doc/html/extra.html
    
Offset 1050, 15 lines modifiedOffset 1050, 15 lines modified
1050 <a·id="__codelineno-2-13"·name="__codelineno-2-13"·href="#__codelineno-2-13"></a>········<span·class="nb">print</span><span·class="p">(</span><span·class="s2">&quot;some·error&quot;</span><span·class="p">,</span>·<span·class="n">file</span><span·class="o">=</span><span·class="n">sys</span><span·class="o">.</span><span·class="n">stderr</span><span·class="p">)</span>1050 <a·id="__codelineno-2-13"·name="__codelineno-2-13"·href="#__codelineno-2-13"></a>········<span·class="nb">print</span><span·class="p">(</span><span·class="s2">&quot;some·error&quot;</span><span·class="p">,</span>·<span·class="n">file</span><span·class="o">=</span><span·class="n">sys</span><span·class="o">.</span><span·class="n">stderr</span><span·class="p">)</span>
1051 </code></pre></div></p>1051 </code></pre></div></p>
1052 </div>1052 </div>
1053 </div>1053 </div>
1054 </div>1054 </div>
  
1055 ············<details·class="quote">1055 ············<details·class="quote">
1056 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py</code></summary>1056 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py</code></summary>
1057 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-63">·63</a></span>1057 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-63">·63</a></span>
1058 <span·class="normal"><a·href="#__codelineno-0-64">·64</a></span>1058 <span·class="normal"><a·href="#__codelineno-0-64">·64</a></span>
1059 <span·class="normal"><a·href="#__codelineno-0-65">·65</a></span>1059 <span·class="normal"><a·href="#__codelineno-0-65">·65</a></span>
1060 <span·class="normal"><a·href="#__codelineno-0-66">·66</a></span>1060 <span·class="normal"><a·href="#__codelineno-0-66">·66</a></span>
1061 <span·class="normal"><a·href="#__codelineno-0-67">·67</a></span>1061 <span·class="normal"><a·href="#__codelineno-0-67">·67</a></span>
1062 <span·class="normal"><a·href="#__codelineno-0-68">·68</a></span>1062 <span·class="normal"><a·href="#__codelineno-0-68">·68</a></span>
1063 <span·class="normal"><a·href="#__codelineno-0-69">·69</a></span>1063 <span·class="normal"><a·href="#__codelineno-0-69">·69</a></span>
Offset 1263, 15 lines modifiedOffset 1263, 15 lines modified
1263 </span><a·id="__codelineno-1-7"·name="__codelineno-1-7"·href="#__codelineno-1-7"></a>········<span·class="mi">1</span>·<span·class="o">/</span>·<span·class="mi">0</span>1263 </span><a·id="__codelineno-1-7"·name="__codelineno-1-7"·href="#__codelineno-1-7"></a>········<span·class="mi">1</span>·<span·class="o">/</span>·<span·class="mi">0</span>
1264 </code></pre></div></p>1264 </code></pre></div></p>
1265 </div>1265 </div>
1266 </div>1266 </div>
1267 </div>1267 </div>
  
1268 ············<details·class="quote">1268 ············<details·class="quote">
1269 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py</code></summary>1269 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py</code></summary>
1270 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-17">17</a></span>1270 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-17">17</a></span>
1271 <span·class="normal"><a·href="#__codelineno-0-18">18</a></span>1271 <span·class="normal"><a·href="#__codelineno-0-18">18</a></span>
1272 <span·class="normal"><a·href="#__codelineno-0-19">19</a></span>1272 <span·class="normal"><a·href="#__codelineno-0-19">19</a></span>
1273 <span·class="normal"><a·href="#__codelineno-0-20">20</a></span>1273 <span·class="normal"><a·href="#__codelineno-0-20">20</a></span>
1274 <span·class="normal"><a·href="#__codelineno-0-21">21</a></span>1274 <span·class="normal"><a·href="#__codelineno-0-21">21</a></span>
1275 <span·class="normal"><a·href="#__codelineno-0-22">22</a></span>1275 <span·class="normal"><a·href="#__codelineno-0-22">22</a></span>
1276 <span·class="normal"><a·href="#__codelineno-0-23">23</a></span>1276 <span·class="normal"><a·href="#__codelineno-0-23">23</a></span>
Offset 1469, 15 lines modifiedOffset 1469, 15 lines modified
1469 </span><a·id="__codelineno-1-8"·name="__codelineno-1-8"·href="#__codelineno-1-8"></a>········<span·class="n">warn</span><span·class="p">(</span><span·class="s2">&quot;some·problem&quot;</span><span·class="p">)</span>1469 </span><a·id="__codelineno-1-8"·name="__codelineno-1-8"·href="#__codelineno-1-8"></a>········<span·class="n">warn</span><span·class="p">(</span><span·class="s2">&quot;some·problem&quot;</span><span·class="p">)</span>
1470 </code></pre></div></p>1470 </code></pre></div></p>
1471 </div>1471 </div>
1472 </div>1472 </div>
1473 </div>1473 </div>
  
1474 ············<details·class="quote">1474 ············<details·class="quote">
1475 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py</code></summary>1475 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py</code></summary>
1476 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-136">136</a></span>1476 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-136">136</a></span>
1477 <span·class="normal"><a·href="#__codelineno-0-137">137</a></span>1477 <span·class="normal"><a·href="#__codelineno-0-137">137</a></span>
1478 <span·class="normal"><a·href="#__codelineno-0-138">138</a></span>1478 <span·class="normal"><a·href="#__codelineno-0-138">138</a></span>
1479 <span·class="normal"><a·href="#__codelineno-0-139">139</a></span>1479 <span·class="normal"><a·href="#__codelineno-0-139">139</a></span>
1480 <span·class="normal"><a·href="#__codelineno-0-140">140</a></span>1480 <span·class="normal"><a·href="#__codelineno-0-140">140</a></span>
1481 <span·class="normal"><a·href="#__codelineno-0-141">141</a></span>1481 <span·class="normal"><a·href="#__codelineno-0-141">141</a></span>
1482 <span·class="normal"><a·href="#__codelineno-0-142">142</a></span>1482 <span·class="normal"><a·href="#__codelineno-0-142">142</a></span>
1.86 KB
html2text {}
    
Offset 82, 15 lines modifiedOffset 82, 15 lines modified
82 def·test_prints():82 def·test_prints():
83 ····with·prints(83 ····with·prints(
84 ········stdout=IsStr(),84 ········stdout=IsStr(),
85 ········stderr=snapshot("some·error\n"),85 ········stderr=snapshot("some·error\n"),
86 ····):86 ····):
87 ········print("hello·world")87 ········print("hello·world")
88 ········print("some·error",·file=sys.stderr)88 ········print("some·error",·file=sys.stderr)
89 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/89 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
90 extra.py90 extra.py
91 ····@contextlib.contextmanager91 ····@contextlib.contextmanager
92 _\x8·_\x86_\x83·def·prints(*,·stdout:·Snapshot[str]·=·"",·stderr:·Snapshot[str]·=·""):92 _\x8·_\x86_\x83·def·prints(*,·stdout:·Snapshot[str]·=·"",·stderr:·Snapshot[str]·=·""):
93 _\x8·_\x86_\x84·····"""Uses·`contextlib.redirect_stderr/stdout`·to·capture·the·output·and93 _\x8·_\x86_\x84·····"""Uses·`contextlib.redirect_stderr/stdout`·to·capture·the·output·and
94 _\x8·_\x86_\x85·····compare·it·with·the·snapshots.·`dirty_equals.IsStr`·can·be·used·to94 _\x8·_\x86_\x85·····compare·it·with·the·snapshots.·`dirty_equals.IsStr`·can·be·used·to
95 _\x8·_\x86_\x86·ignore95 _\x8·_\x86_\x86·ignore
96 _\x8·_\x86_\x87·····the·output·if·needed.96 _\x8·_\x86_\x87·····the·output·if·needed.
Offset 178, 15 lines modifiedOffset 178, 15 lines modified
178 from·inline_snapshot·import·snapshot178 from·inline_snapshot·import·snapshot
179 from·inline_snapshot.extra·import·raises179 from·inline_snapshot.extra·import·raises
  
  
180 def·test_raises():180 def·test_raises():
181 ····with·raises(snapshot("ZeroDivisionError:·division·by·zero")):181 ····with·raises(snapshot("ZeroDivisionError:·division·by·zero")):
182 ········1·/·0182 ········1·/·0
183 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/183 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
184 extra.py184 extra.py
185 ···@contextlib.contextmanager185 ···@contextlib.contextmanager
186 _\x81_\x87·def·raises(exception:·Snapshot[str]):186 _\x81_\x87·def·raises(exception:·Snapshot[str]):
187 _\x81_\x88·····"""Check·that·an·exception·is·raised.187 _\x81_\x88·····"""Check·that·an·exception·is·raised.
188 _\x81_\x89188 _\x81_\x89
189 _\x82_\x80·····Parameters:189 _\x82_\x80·····Parameters:
190 _\x82_\x81·········exception:·snapshot·which·is·compared·with·`#!python·f"{type}:190 _\x82_\x81·········exception:·snapshot·which·is·compared·with·`#!python·f"{type}:
Offset 265, 15 lines modifiedOffset 265, 15 lines modified
265 from·warnings·import·warn265 from·warnings·import·warn
  
  
266 def·test_warns():266 def·test_warns():
267 ····with·warns(snapshot([(8,·"UserWarning:·some·problem")]),267 ····with·warns(snapshot([(8,·"UserWarning:·some·problem")]),
268 include_line=True):268 include_line=True):
269 ········warn("some·problem")269 ········warn("some·problem")
270 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/270 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
271 extra.py271 extra.py
272 ····@contextlib.contextmanager272 ····@contextlib.contextmanager
273 ····def·warns(273 ····def·warns(
274 ········expected_warnings:·Snapshot[List[Warning]],274 ········expected_warnings:·Snapshot[List[Warning]],
275 _\x81_\x83_\x86·····/,275 _\x81_\x83_\x86·····/,
276 _\x81_\x83_\x87·····include_line:·bool·=·False,276 _\x81_\x83_\x87·····include_line:·bool·=·False,
277 _\x81_\x83_\x88·····include_file:·bool·=·False,277 _\x81_\x83_\x88·····include_file:·bool·=·False,
8.98 KB
./usr/share/doc/python-inline-snapshot-doc/html/outsource.html
    
Offset 1167, 15 lines modifiedOffset 1167, 15 lines modified
1167 ··············</div>1167 ··············</div>
1168 ············</td>1168 ············</td>
1169 ··········</tr>1169 ··········</tr>
1170 ······</tbody>1170 ······</tbody>
1171 ····</table>1171 ····</table>
  
1172 ············<details·class="quote">1172 ············<details·class="quote">
1173 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code></summary>1173 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code></summary>
1174 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-137">137</a></span>1174 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-137">137</a></span>
1175 <span·class="normal"><a·href="#__codelineno-0-138">138</a></span>1175 <span·class="normal"><a·href="#__codelineno-0-138">138</a></span>
1176 <span·class="normal"><a·href="#__codelineno-0-139">139</a></span>1176 <span·class="normal"><a·href="#__codelineno-0-139">139</a></span>
1177 <span·class="normal"><a·href="#__codelineno-0-140">140</a></span>1177 <span·class="normal"><a·href="#__codelineno-0-140">140</a></span>
1178 <span·class="normal"><a·href="#__codelineno-0-141">141</a></span>1178 <span·class="normal"><a·href="#__codelineno-0-141">141</a></span>
1179 <span·class="normal"><a·href="#__codelineno-0-142">142</a></span>1179 <span·class="normal"><a·href="#__codelineno-0-142">142</a></span>
1180 <span·class="normal"><a·href="#__codelineno-0-143">143</a></span>1180 <span·class="normal"><a·href="#__codelineno-0-143">143</a></span>
Offset 1283, 15 lines modifiedOffset 1283, 15 lines modified
  
  
  
  
  
  
1283 ··············<details·class="quote">1283 ··············<details·class="quote">
1284 ················<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code></summary>1284 ················<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code></summary>
1285 ················<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-76">·76</a></span>1285 ················<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-76">·76</a></span>
1286 <span·class="normal"><a·href="#__codelineno-0-77">·77</a></span>1286 <span·class="normal"><a·href="#__codelineno-0-77">·77</a></span>
1287 <span·class="normal"><a·href="#__codelineno-0-78">·78</a></span>1287 <span·class="normal"><a·href="#__codelineno-0-78">·78</a></span>
1288 <span·class="normal"><a·href="#__codelineno-0-79">·79</a></span>1288 <span·class="normal"><a·href="#__codelineno-0-79">·79</a></span>
1289 <span·class="normal"><a·href="#__codelineno-0-80">·80</a></span>1289 <span·class="normal"><a·href="#__codelineno-0-80">·80</a></span>
1290 <span·class="normal"><a·href="#__codelineno-0-81">·81</a></span>1290 <span·class="normal"><a·href="#__codelineno-0-81">·81</a></span>
1291 <span·class="normal"><a·href="#__codelineno-0-82">·82</a></span>1291 <span·class="normal"><a·href="#__codelineno-0-82">·82</a></span>
Offset 1431, 15 lines modifiedOffset 1431, 15 lines modified
  
1431 ····<div·class="doc·doc-contents·">1431 ····<div·class="doc·doc-contents·">
  
1432 ········<p>Two·external·objects·are·equal·if·they·have·the·same·hash·and1432 ········<p>Two·external·objects·are·equal·if·they·have·the·same·hash·and
1433 suffix.</p>1433 suffix.</p>
  
1434 ············<details·class="quote">1434 ············<details·class="quote">
1435 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code></summary>1435 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code></summary>
1436 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-116">116</a></span>1436 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-116">116</a></span>
1437 <span·class="normal"><a·href="#__codelineno-0-117">117</a></span>1437 <span·class="normal"><a·href="#__codelineno-0-117">117</a></span>
1438 <span·class="normal"><a·href="#__codelineno-0-118">118</a></span>1438 <span·class="normal"><a·href="#__codelineno-0-118">118</a></span>
1439 <span·class="normal"><a·href="#__codelineno-0-119">119</a></span>1439 <span·class="normal"><a·href="#__codelineno-0-119">119</a></span>
1440 <span·class="normal"><a·href="#__codelineno-0-120">120</a></span>1440 <span·class="normal"><a·href="#__codelineno-0-120">120</a></span>
1441 <span·class="normal"><a·href="#__codelineno-0-121">121</a></span>1441 <span·class="normal"><a·href="#__codelineno-0-121">121</a></span>
1442 <span·class="normal"><a·href="#__codelineno-0-122">122</a></span>1442 <span·class="normal"><a·href="#__codelineno-0-122">122</a></span>
Offset 1517, 15 lines modifiedOffset 1517, 15 lines modified
1517 ················<em>required</em>1517 ················<em>required</em>
1518 ············</td>1518 ············</td>
1519 ··········</tr>1519 ··········</tr>
1520 ······</tbody>1520 ······</tbody>
1521 ····</table>1521 ····</table>
  
1522 ············<details·class="quote">1522 ············<details·class="quote">
1523 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code></summary>1523 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code></summary>
1524 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-77">77</a></span>1524 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-77">77</a></span>
1525 <span·class="normal"><a·href="#__codelineno-0-78">78</a></span>1525 <span·class="normal"><a·href="#__codelineno-0-78">78</a></span>
1526 <span·class="normal"><a·href="#__codelineno-0-79">79</a></span>1526 <span·class="normal"><a·href="#__codelineno-0-79">79</a></span>
1527 <span·class="normal"><a·href="#__codelineno-0-80">80</a></span>1527 <span·class="normal"><a·href="#__codelineno-0-80">80</a></span>
1528 <span·class="normal"><a·href="#__codelineno-0-81">81</a></span>1528 <span·class="normal"><a·href="#__codelineno-0-81">81</a></span>
1529 <span·class="normal"><a·href="#__codelineno-0-82">82</a></span>1529 <span·class="normal"><a·href="#__codelineno-0-82">82</a></span>
1530 <span·class="normal"><a·href="#__codelineno-0-83">83</a></span>1530 <span·class="normal"><a·href="#__codelineno-0-83">83</a></span>
Offset 1581, 15 lines modifiedOffset 1581, 15 lines modified
1581 ····<div·class="doc·doc-contents·">1581 ····<div·class="doc·doc-contents·">
  
1582 ········<p>Returns·the·representation·of·the·external·object.</p>1582 ········<p>Returns·the·representation·of·the·external·object.</p>
1583 <p>The·length·of·the·hash·can·be·specified·in·the1583 <p>The·length·of·the·hash·can·be·specified·in·the
1584 <a·href="configuration.html">config</a>.</p>1584 <a·href="configuration.html">config</a>.</p>
  
1585 ············<details·class="quote">1585 ············<details·class="quote">
1586 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code></summary>1586 ··············<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code></summary>
1587 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-103">103</a></span>1587 ··············<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-103">103</a></span>
1588 <span·class="normal"><a·href="#__codelineno-0-104">104</a></span>1588 <span·class="normal"><a·href="#__codelineno-0-104">104</a></span>
1589 <span·class="normal"><a·href="#__codelineno-0-105">105</a></span>1589 <span·class="normal"><a·href="#__codelineno-0-105">105</a></span>
1590 <span·class="normal"><a·href="#__codelineno-0-106">106</a></span>1590 <span·class="normal"><a·href="#__codelineno-0-106">106</a></span>
1591 <span·class="normal"><a·href="#__codelineno-0-107">107</a></span>1591 <span·class="normal"><a·href="#__codelineno-0-107">107</a></span>
1592 <span·class="normal"><a·href="#__codelineno-0-108">108</a></span>1592 <span·class="normal"><a·href="#__codelineno-0-108">108</a></span>
1593 <span·class="normal"><a·href="#__codelineno-0-109">109</a></span>1593 <span·class="normal"><a·href="#__codelineno-0-109">109</a></span>
3.78 KB
html2text {}
    
Offset 115, 15 lines modifiedOffset 115, 15 lines modified
115 ·························encoded·with·"utf-8".115 ·························encoded·with·"utf-8".
116 ·························overwrite·file·suffix.·The·default·is·".bin"116 ·························overwrite·file·suffix.·The·default·is·".bin"
117 suffix·Optional[str]·····if·data·is·an·instance·of·bytes·and·".txt"···None117 suffix·Optional[str]·····if·data·is·an·instance·of·bytes·and·".txt"···None
118 ·························for·str.118 ·························for·str.
119 Returns:119 Returns:
120 T\x8Ty\x8yp\x8pe\x8e·····D\x8De\x8es\x8sc\x8cr\x8ri\x8ip\x8pt\x8ti\x8io\x8on\x8n120 T\x8Ty\x8yp\x8pe\x8e·····D\x8De\x8es\x8sc\x8cr\x8ri\x8ip\x8pt\x8ti\x8io\x8on\x8n
121 _\x8e_\x8x_\x8t_\x8e_\x8r_\x8n_\x8a_\x8l·The·external·data.121 _\x8e_\x8x_\x8t_\x8e_\x8r_\x8n_\x8a_\x8l·The·external·data.
122 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/122 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
123 _external.py123 _external.py
124 ····def·outsource(data:·Union[str,·bytes],·*,·suffix:·Optional[str]·=·None)·-124 ····def·outsource(data:·Union[str,·bytes],·*,·suffix:·Optional[str]·=·None)·-
125 ····>·external:125 ····>·external:
126 _\x81_\x83_\x87·····"""Outsource·some·data·into·an·external·file.126 _\x81_\x83_\x87·····"""Outsource·some·data·into·an·external·file.
127 _\x81_\x83_\x88127 _\x81_\x83_\x88
128 _\x81_\x83_\x89·····```·pycon128 _\x81_\x83_\x89·····```·pycon
129 _\x81_\x84_\x80·····>>>·png_data·=·b"some_bytes"··#·should·be·the·replaced·with·your·actual129 _\x81_\x84_\x80·····>>>·png_data·=·b"some_bytes"··#·should·be·the·replaced·with·your·actual
Offset 167, 15 lines modifiedOffset 167, 15 lines modified
167 _\x81_\x87_\x88167 _\x81_\x87_\x88
168 _\x81_\x87_\x89·····if·not·storage.lookup_all(name):168 _\x81_\x87_\x89·····if·not·storage.lookup_all(name):
169 _\x81_\x88_\x80·········path·=·hash·+·"-new"·+·suffix169 _\x81_\x88_\x80·········path·=·hash·+·"-new"·+·suffix
170 _\x81_\x88_\x81·········storage.save(path,·data)170 _\x81_\x88_\x81·········storage.save(path,·data)
  
171 ········return·external(name)171 ········return·external(name)
172 i\x8in\x8nl\x8li\x8in\x8ne\x8e_\x8_s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t.\x8.e\x8ex\x8xt\x8te\x8er\x8rn\x8na\x8al\x8l·_\x8?\x8172 i\x8in\x8nl\x8li\x8in\x8ne\x8e_\x8_s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t.\x8.e\x8ex\x8xt\x8te\x8er\x8rn\x8na\x8al\x8l·_\x8?\x8
173 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/173 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
174 _external.py174 _external.py
175 ····class·external:175 ····class·external:
176 ········def·__init__(self,·name:·str):176 ········def·__init__(self,·name:·str):
177 ············"""External·objects·are·used·as·a·representation·for·outsourced177 ············"""External·objects·are·used·as·a·representation·for·outsourced
178 _\x8·_\x87_\x86·data.178 _\x8·_\x87_\x86·data.
179 _\x8·_\x87_\x87·········You·should·not·create·them·directly.179 _\x8·_\x87_\x87·········You·should·not·create·them·directly.
180 _\x8·_\x87_\x88180 _\x8·_\x87_\x88
Offset 236, 15 lines modifiedOffset 236, 15 lines modified
236 _\x81_\x83_\x83·········return·True236 _\x81_\x83_\x83·········return·True
237 _\x81_\x83_\x84237 _\x81_\x83_\x84
238 ········def·_load_value(self):238 ········def·_load_value(self):
239 ············assert·storage·is·not·None239 ············assert·storage·is·not·None
240 ············return·storage.read(self._path)240 ············return·storage.read(self._path)
241 _\x8__\x8_e\x8eq\x8q_\x8__\x8_(\x8(o\x8ot\x8th\x8he\x8er\x8r)\x8)·_\x8?\x8241 _\x8__\x8_e\x8eq\x8q_\x8__\x8_(\x8(o\x8ot\x8th\x8he\x8er\x8r)\x8)·_\x8?\x8
242 Two·external·objects·are·equal·if·they·have·the·same·hash·and·suffix.242 Two·external·objects·are·equal·if·they·have·the·same·hash·and·suffix.
243 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/243 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
244 _external.py244 _external.py
245 _\x81_\x81_\x86·def·__eq__(self,·other):245 _\x81_\x81_\x86·def·__eq__(self,·other):
246 _\x81_\x81_\x87·····"""Two·external·objects·are·equal·if·they·have·the·same·hash·and246 _\x81_\x81_\x87·····"""Two·external·objects·are·equal·if·they·have·the·same·hash·and
247 _\x81_\x81_\x88·····suffix."""247 _\x81_\x81_\x88·····suffix."""
248 _\x81_\x81_\x89·····if·not·isinstance(other,·external):248 _\x81_\x81_\x89·····if·not·isinstance(other,·external):
249 _\x81_\x82_\x80·········return·NotImplemented249 _\x81_\x82_\x80·········return·NotImplemented
250 _\x81_\x82_\x81250 _\x81_\x82_\x81
Offset 265, 15 lines modifiedOffset 265, 15 lines modified
265 containing·the·Pytest·configuration·file,·if·any.·To·store·data·in·a·different265 containing·the·Pytest·configuration·file,·if·any.·To·store·data·in·a·different
266 location,·set·the·storage-dir·option·in·pyproject.toml.·Data·which·is266 location,·set·the·storage-dir·option·in·pyproject.toml.·Data·which·is
267 outsourced·but·not·referenced·in·the·source·code·jet·has·a·'-new'·suffix·in·the267 outsourced·but·not·referenced·in·the·source·code·jet·has·a·'-new'·suffix·in·the
268 filename.268 filename.
269 Parameters:269 Parameters:
270 N\x8Na\x8am\x8me\x8e·T\x8Ty\x8yp\x8pe\x8e·D\x8De\x8es\x8sc\x8cr\x8ri\x8ip\x8pt\x8ti\x8io\x8on\x8n·····························D\x8De\x8ef\x8fa\x8au\x8ul\x8lt\x8t270 N\x8Na\x8am\x8me\x8e·T\x8Ty\x8yp\x8pe\x8e·D\x8De\x8es\x8sc\x8cr\x8ri\x8ip\x8pt\x8ti\x8io\x8on\x8n·····························D\x8De\x8ef\x8fa\x8au\x8ul\x8lt\x8t
271 name·str··the·name·of·the·external·stored·object.·r\x8re\x8eq\x8qu\x8ui\x8ir\x8re\x8ed\x8d271 name·str··the·name·of·the·external·stored·object.·r\x8re\x8eq\x8qu\x8ui\x8ir\x8re\x8ed\x8d
272 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/272 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
273 _external.py273 _external.py
274 ···def·__init__(self,·name:·str):274 ···def·__init__(self,·name:·str):
275 ·······"""External·objects·are·used·as·a·representation·for·outsourced·data.275 ·······"""External·objects·are·used·as·a·representation·for·outsourced·data.
276 _\x87_\x87·····You·should·not·create·them·directly.276 _\x87_\x87·····You·should·not·create·them·directly.
277 _\x87_\x88277 _\x87_\x88
278 _\x87_\x89·····The·external·data·is·by·default·stored·inside278 _\x87_\x89·····The·external·data·is·by·default·stored·inside
279 _\x88_\x80·`<pytest_config_dir>/.inline-snapshot/external`,279 _\x88_\x80·`<pytest_config_dir>/.inline-snapshot/external`,
Offset 296, 15 lines modifiedOffset 296, 15 lines modified
296 _\x89_\x87·········raise·ValueError(296 _\x89_\x87·········raise·ValueError(
297 ···············"path·has·to·be·of·the·form·<hash>.<suffix>·or297 ···············"path·has·to·be·of·the·form·<hash>.<suffix>·or
298 ···<partial_hash>*.<suffix>"298 ···<partial_hash>*.<suffix>"
299 ···········)299 ···········)
300 _\x8__\x8_r\x8re\x8ep\x8pr\x8r_\x8__\x8_(\x8()\x8)·_\x8?\x8300 _\x8__\x8_r\x8re\x8ep\x8pr\x8r_\x8__\x8_(\x8()\x8)·_\x8?\x8
301 Returns·the·representation·of·the·external·object.301 Returns·the·representation·of·the·external·object.
302 The·length·of·the·hash·can·be·specified·in·the·_\x8c_\x8o_\x8n_\x8f_\x8i_\x8g.302 The·length·of·the·hash·can·be·specified·in·the·_\x8c_\x8o_\x8n_\x8f_\x8i_\x8g.
303 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/303 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
304 _external.py304 _external.py
305 _\x81_\x80_\x83·def·__repr__(self):305 _\x81_\x80_\x83·def·__repr__(self):
306 _\x81_\x80_\x84·····"""Returns·the·representation·of·the·external·object.306 _\x81_\x80_\x84·····"""Returns·the·representation·of·the·external·object.
307 _\x81_\x80_\x85307 _\x81_\x80_\x85
308 _\x81_\x80_\x86·····The·length·of·the·hash·can·be·specified·in·the308 _\x81_\x80_\x86·····The·length·of·the·hash·can·be·specified·in·the
309 _\x81_\x80_\x87·····[config](configuration.md).309 _\x81_\x80_\x87·····[config](configuration.md).
310 _\x81_\x80_\x88·····"""310 _\x81_\x80_\x88·····"""
22.0 KB
./usr/share/doc/python-inline-snapshot-doc/html/pytest.html
    
Offset 967, 16 lines modifiedOffset 967, 16 lines modified
967 <a·id="__codelineno-1-4"·name="__codelineno-1-4"·href="#__codelineno-1-4"></a><span·class="k">def</span>·<span·class="nf">test_something</span><span·class="p">():</span>967 <a·id="__codelineno-1-4"·name="__codelineno-1-4"·href="#__codelineno-1-4"></a><span·class="k">def</span>·<span·class="nf">test_something</span><span·class="p">():</span>
968 <a·id="__codelineno-1-5"·name="__codelineno-1-5"·href="#__codelineno-1-5"></a>····<span·class="k">assert</span>·<span·class="mi">1</span>·<span·class="o">==</span>·<span·class="n">snapshot</span><span·class="p">()</span>968 <a·id="__codelineno-1-5"·name="__codelineno-1-5"·href="#__codelineno-1-5"></a>····<span·class="k">assert</span>·<span·class="mi">1</span>·<span·class="o">==</span>·<span·class="n">snapshot</span><span·class="p">()</span>
969 <a·id="__codelineno-1-6"·name="__codelineno-1-6"·href="#__codelineno-1-6"></a>····<span·class="k">assert</span>·<span·class="mi">2</span>·<span·class="o">&lt;=</span>·<span·class="n">snapshot</span><span·class="p">(</span><span·class="mi">5</span><span·class="p">)</span>969 <a·id="__codelineno-1-6"·name="__codelineno-1-6"·href="#__codelineno-1-6"></a>····<span·class="k">assert</span>·<span·class="mi">2</span>·<span·class="o">&lt;=</span>·<span·class="n">snapshot</span><span·class="p">(</span><span·class="mi">5</span><span·class="p">)</span>
970 </code></pre></div>970 </code></pre></div>
971 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=create,report971 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=create,report
972 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m972 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m
973 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0973 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
974 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.kFFW8kHLKp974 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.60FAWnReg3
975 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0975 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
976 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item976 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item
977 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>977 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>
978 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[32m······················································[100%]\x1b[0m978 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[32m······················································[100%]\x1b[0m
979 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>===============================·inline·snapshot·================================979 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>===============================·inline·snapshot·================================
980 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>───────────────────────────────·Create·snapshots·───────────────────────────────980 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>───────────────────────────────·Create·snapshots·───────────────────────────────
981 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>+-----------------------------·test_something.py·------------------------------+981 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>+-----------------------------·test_something.py·------------------------------+
982 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>|·@@·-2,5·+2,5·@@······························································|982 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>|·@@·-2,5·+2,5·@@······························································|
Offset 1001, 51 lines modifiedOffset 1001, 51 lines modified
1001 <a·id="__codelineno-0-31"·name="__codelineno-0-31"·href="#__codelineno-0-31"></a>|·+····assert·2·&lt;=·snapshot(2)·················································|1001 <a·id="__codelineno-0-31"·name="__codelineno-0-31"·href="#__codelineno-0-31"></a>|·+····assert·2·&lt;=·snapshot(2)·················································|
1002 <a·id="__codelineno-0-32"·name="__codelineno-0-32"·href="#__codelineno-0-32"></a>+------------------------------------------------------------------------------+1002 <a·id="__codelineno-0-32"·name="__codelineno-0-32"·href="#__codelineno-0-32"></a>+------------------------------------------------------------------------------+
1003 <a·id="__codelineno-0-33"·name="__codelineno-0-33"·href="#__codelineno-0-33"></a>These·changes·are·not·applied.1003 <a·id="__codelineno-0-33"·name="__codelineno-0-33"·href="#__codelineno-0-33"></a>These·changes·are·not·applied.
1004 <a·id="__codelineno-0-34"·name="__codelineno-0-34"·href="#__codelineno-0-34"></a>Use·--inline-snapshot=trim·to·apply·them,·or·use·the·interactive·mode·with·1004 <a·id="__codelineno-0-34"·name="__codelineno-0-34"·href="#__codelineno-0-34"></a>Use·--inline-snapshot=trim·to·apply·them,·or·use·the·interactive·mode·with·
1005 <a·id="__codelineno-0-35"·name="__codelineno-0-35"·href="#__codelineno-0-35"></a>--inline-snapshot=review1005 <a·id="__codelineno-0-35"·name="__codelineno-0-35"·href="#__codelineno-0-35"></a>--inline-snapshot=review
1006 <a·id="__codelineno-0-36"·name="__codelineno-0-36"·href="#__codelineno-0-36"></a>1006 <a·id="__codelineno-0-36"·name="__codelineno-0-36"·href="#__codelineno-0-36"></a>
1007 <a·id="__codelineno-0-37"·name="__codelineno-0-37"·href="#__codelineno-0-37"></a>1007 <a·id="__codelineno-0-37"·name="__codelineno-0-37"·href="#__codelineno-0-37"></a>
1008 <a·id="__codelineno-0-38"·name="__codelineno-0-38"·href="#__codelineno-0-38"></a>\x1b[32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·0.25s\x1b[0m\x1b[32m·===============================\x1b[0m1008 <a·id="__codelineno-0-38"·name="__codelineno-0-38"·href="#__codelineno-0-38"></a>\x1b[32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·2.10s\x1b[0m\x1b[32m·===============================\x1b[0m
1009 </code></pre></div>1009 </code></pre></div>
1010 <h2·id="-inline-snapshotshort-report">--inline-snapshot=short-report<a·class="headerlink"·href="#-inline-snapshotshort-report"·title="Permanent·link">&para;</a></h2>1010 <h2·id="-inline-snapshotshort-report">--inline-snapshot=short-report<a·class="headerlink"·href="#-inline-snapshotshort-report"·title="Permanent·link">&para;</a></h2>
1011 <p>give·a·short·report·over·which·changes·can·be·made·to·the·snapshots</p>1011 <p>give·a·short·report·over·which·changes·can·be·made·to·the·snapshots</p>
1012 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=short-report1012 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=short-report
1013 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m1013 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m
1014 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.01014 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
1015 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.WxEiV9suHD1015 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.wduPXdW8gH
1016 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.01016 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
1017 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item1017 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item
1018 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>1018 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>
1019 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m·····················································[100%]\x1b[0m1019 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m·····················································[100%]\x1b[0m
1020 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>1020 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>
1021 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>====================================·ERRORS·====================================1021 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>====================================·ERRORS·====================================
1022 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>\x1b[31m\x1b[1m_____________________·ERROR·at·teardown·of·test_something·______________________\x1b[0m1022 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>\x1b[31m\x1b[1m_____________________·ERROR·at·teardown·of·test_something·______________________\x1b[0m
1023 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>your·snapshot·is·missing·one·value.1023 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>your·snapshot·is·missing·one·value.
1024 <a·id="__codelineno-0-13"·name="__codelineno-0-13"·href="#__codelineno-0-13"></a>===============================·inline·snapshot·================================1024 <a·id="__codelineno-0-13"·name="__codelineno-0-13"·href="#__codelineno-0-13"></a>===============================·inline·snapshot·================================
1025 <a·id="__codelineno-0-14"·name="__codelineno-0-14"·href="#__codelineno-0-14"></a>Info:·one·snapshot·can·be·trimmed·(--inline-snapshot=trim)1025 <a·id="__codelineno-0-14"·name="__codelineno-0-14"·href="#__codelineno-0-14"></a>Info:·one·snapshot·can·be·trimmed·(--inline-snapshot=trim)
1026 <a·id="__codelineno-0-15"·name="__codelineno-0-15"·href="#__codelineno-0-15"></a>Error:·one·snapshot·is·missing·a·value·(--inline-snapshot=create)1026 <a·id="__codelineno-0-15"·name="__codelineno-0-15"·href="#__codelineno-0-15"></a>Error:·one·snapshot·is·missing·a·value·(--inline-snapshot=create)
1027 <a·id="__codelineno-0-16"·name="__codelineno-0-16"·href="#__codelineno-0-16"></a>1027 <a·id="__codelineno-0-16"·name="__codelineno-0-16"·href="#__codelineno-0-16"></a>
1028 <a·id="__codelineno-0-17"·name="__codelineno-0-17"·href="#__codelineno-0-17"></a>You·can·also·use·--inline-snapshot=review·to·approve·the·changes·interactively1028 <a·id="__codelineno-0-17"·name="__codelineno-0-17"·href="#__codelineno-0-17"></a>You·can·also·use·--inline-snapshot=review·to·approve·the·changes·interactively
1029 <a·id="__codelineno-0-18"·name="__codelineno-0-18"·href="#__codelineno-0-18"></a>\x1b[36m\x1b[1m===========================·short·test·summary·info·============================\x1b[0m1029 <a·id="__codelineno-0-18"·name="__codelineno-0-18"·href="#__codelineno-0-18"></a>\x1b[36m\x1b[1m===========================·short·test·summary·info·============================\x1b[0m
1030 <a·id="__codelineno-0-19"·name="__codelineno-0-19"·href="#__codelineno-0-19"></a>\x1b[31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot·is·missing·one·value.1030 <a·id="__codelineno-0-19"·name="__codelineno-0-19"·href="#__codelineno-0-19"></a>\x1b[31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot·is·missing·one·value.
1031 <a·id="__codelineno-0-20"·name="__codelineno-0-20"·href="#__codelineno-0-20"></a>\x1b[31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in·0.22s\x1b[0m\x1b[31m·==========================\x1b[0m1031 <a·id="__codelineno-0-20"·name="__codelineno-0-20"·href="#__codelineno-0-20"></a>\x1b[31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in·1.37s\x1b[0m\x1b[31m·==========================\x1b[0m
1032 </code></pre></div>1032 </code></pre></div>
1033 <div·class="admonition·info">1033 <div·class="admonition·info">
1034 <p·class="admonition-title">Info</p>1034 <p·class="admonition-title">Info</p>
1035 <p>short-report·exists·mainly·to·show·that·snapshots·have·changed·with·enabled·pytest·assert-rewriting.1035 <p>short-report·exists·mainly·to·show·that·snapshots·have·changed·with·enabled·pytest·assert-rewriting.
1036 This·option·will·be·replaced·with·<em>report</em>·when·this·restriction·is·lifted.</p>1036 This·option·will·be·replaced·with·<em>report</em>·when·this·restriction·is·lifted.</p>
1037 </div>1037 </div>
1038 <h2·id="-inline-snapshotreport">--inline-snapshot=report<a·class="headerlink"·href="#-inline-snapshotreport"·title="Permanent·link">&para;</a></h2>1038 <h2·id="-inline-snapshotreport">--inline-snapshot=report<a·class="headerlink"·href="#-inline-snapshotreport"·title="Permanent·link">&para;</a></h2>
1039 <p>Shows·a·diff·report·over·which·changes·can·be·made·to·the·snapshots</p>1039 <p>Shows·a·diff·report·over·which·changes·can·be·made·to·the·snapshots</p>
1040 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=report1040 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=report
1041 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m1041 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m
1042 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.01042 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
1043 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.pvYajNAczw1043 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.cu7h0QkmhQ
1044 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.01044 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
1045 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item1045 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item
1046 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>1046 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>
1047 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m·····················································[100%]\x1b[0m1047 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m·····················································[100%]\x1b[0m
1048 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>1048 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>
1049 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>====================================·ERRORS·====================================1049 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>====================================·ERRORS·====================================
1050 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>\x1b[31m\x1b[1m_____________________·ERROR·at·teardown·of·test_something·______________________\x1b[0m1050 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>\x1b[31m\x1b[1m_____________________·ERROR·at·teardown·of·test_something·______________________\x1b[0m
1051 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>your·snapshot·is·missing·one·value.1051 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>your·snapshot·is·missing·one·value.
Offset 1077, 23 lines modifiedOffset 1077, 23 lines modified
1077 <a·id="__codelineno-0-38"·name="__codelineno-0-38"·href="#__codelineno-0-38"></a>+------------------------------------------------------------------------------+1077 <a·id="__codelineno-0-38"·name="__codelineno-0-38"·href="#__codelineno-0-38"></a>+------------------------------------------------------------------------------+
1078 <a·id="__codelineno-0-39"·name="__codelineno-0-39"·href="#__codelineno-0-39"></a>These·changes·are·not·applied.1078 <a·id="__codelineno-0-39"·name="__codelineno-0-39"·href="#__codelineno-0-39"></a>These·changes·are·not·applied.
1079 <a·id="__codelineno-0-40"·name="__codelineno-0-40"·href="#__codelineno-0-40"></a>Use·--inline-snapshot=trim·to·apply·them,·or·use·the·interactive·mode·with·1079 <a·id="__codelineno-0-40"·name="__codelineno-0-40"·href="#__codelineno-0-40"></a>Use·--inline-snapshot=trim·to·apply·them,·or·use·the·interactive·mode·with·
1080 <a·id="__codelineno-0-41"·name="__codelineno-0-41"·href="#__codelineno-0-41"></a>--inline-snapshot=review1080 <a·id="__codelineno-0-41"·name="__codelineno-0-41"·href="#__codelineno-0-41"></a>--inline-snapshot=review
1081 <a·id="__codelineno-0-42"·name="__codelineno-0-42"·href="#__codelineno-0-42"></a>1081 <a·id="__codelineno-0-42"·name="__codelineno-0-42"·href="#__codelineno-0-42"></a>
1082 <a·id="__codelineno-0-43"·name="__codelineno-0-43"·href="#__codelineno-0-43"></a>\x1b[36m\x1b[1m===========================·short·test·summary·info·============================\x1b[0m1082 <a·id="__codelineno-0-43"·name="__codelineno-0-43"·href="#__codelineno-0-43"></a>\x1b[36m\x1b[1m===========================·short·test·summary·info·============================\x1b[0m
1083 <a·id="__codelineno-0-44"·name="__codelineno-0-44"·href="#__codelineno-0-44"></a>\x1b[31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot·is·missing·one·value.1083 <a·id="__codelineno-0-44"·name="__codelineno-0-44"·href="#__codelineno-0-44"></a>\x1b[31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot·is·missing·one·value.
1084 <a·id="__codelineno-0-45"·name="__codelineno-0-45"·href="#__codelineno-0-45"></a>\x1b[31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in·0.23s\x1b[0m\x1b[31m·==========================\x1b[0m1084 <a·id="__codelineno-0-45"·name="__codelineno-0-45"·href="#__codelineno-0-45"></a>\x1b[31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in·0.56s\x1b[0m\x1b[31m·==========================\x1b[0m
1085 </code></pre></div>1085 </code></pre></div>
1086 <h2·id="-inline-snapshotreview">--inline-snapshot=review<a·class="headerlink"·href="#-inline-snapshotreview"·title="Permanent·link">&para;</a></h2>1086 <h2·id="-inline-snapshotreview">--inline-snapshot=review<a·class="headerlink"·href="#-inline-snapshotreview"·title="Permanent·link">&para;</a></h2>
1087 <p>Shows·a·diff·report·for·each·category·and·ask·if·you·want·to·apply·the·changes</p>1087 <p>Shows·a·diff·report·for·each·category·and·ask·if·you·want·to·apply·the·changes</p>
1088 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=review1088 <div·class="highlight"><pre><span></span><code><a·id="__codelineno-0-1"·name="__codelineno-0-1"·href="#__codelineno-0-1"></a>\x1b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=review
1089 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m1089 <a·id="__codelineno-0-2"·name="__codelineno-0-2"·href="#__codelineno-0-2"></a>\x1b[0m\x1b[1m=============================·test·session·starts·==============================\x1b[0m
1090 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.01090 <a·id="__codelineno-0-3"·name="__codelineno-0-3"·href="#__codelineno-0-3"></a>platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
1091 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.9CRz6fCaz71091 <a·id="__codelineno-0-4"·name="__codelineno-0-4"·href="#__codelineno-0-4"></a>rootdir:·/tmp/tmp.aKuOS0UTRs
1092 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.01092 <a·id="__codelineno-0-5"·name="__codelineno-0-5"·href="#__codelineno-0-5"></a>plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
1093 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item1093 <a·id="__codelineno-0-6"·name="__codelineno-0-6"·href="#__codelineno-0-6"></a>collected·1·item
1094 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>1094 <a·id="__codelineno-0-7"·name="__codelineno-0-7"·href="#__codelineno-0-7"></a>
1095 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[32m······················································[100%]\x1b[0m1095 <a·id="__codelineno-0-8"·name="__codelineno-0-8"·href="#__codelineno-0-8"></a>test_something.py·\x1b[32m.\x1b[0m\x1b[32m······················································[100%]\x1b[0m
1096 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>===============================·inline·snapshot·================================1096 <a·id="__codelineno-0-9"·name="__codelineno-0-9"·href="#__codelineno-0-9"></a>===============================·inline·snapshot·================================
1097 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>───────────────────────────────·Create·snapshots·───────────────────────────────1097 <a·id="__codelineno-0-10"·name="__codelineno-0-10"·href="#__codelineno-0-10"></a>───────────────────────────────·Create·snapshots·───────────────────────────────
1098 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>+-----------------------------·test_something.py·------------------------------+1098 <a·id="__codelineno-0-11"·name="__codelineno-0-11"·href="#__codelineno-0-11"></a>+-----------------------------·test_something.py·------------------------------+
1099 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>|·@@·-2,5·+2,5·@@······························································|1099 <a·id="__codelineno-0-12"·name="__codelineno-0-12"·href="#__codelineno-0-12"></a>|·@@·-2,5·+2,5·@@······························································|
Offset 1114, 15 lines modifiedOffset 1114, 15 lines modified
1114 <a·id="__codelineno-0-27"·name="__codelineno-0-27"·href="#__codelineno-0-27"></a>|··def·test_something():·······················································|1114 <a·id="__codelineno-0-27"·name="__codelineno-0-27"·href="#__codelineno-0-27"></a>|··def·test_something():·······················································|
1115 <a·id="__codelineno-0-28"·name="__codelineno-0-28"·href="#__codelineno-0-28"></a>|······assert·1·==·snapshot(1)·················································|1115 <a·id="__codelineno-0-28"·name="__codelineno-0-28"·href="#__codelineno-0-28"></a>|······assert·1·==·snapshot(1)·················································|
1116 <a·id="__codelineno-0-29"·name="__codelineno-0-29"·href="#__codelineno-0-29"></a>|·-····assert·2·&lt;=·snapshot(5)·················································|1116 <a·id="__codelineno-0-29"·name="__codelineno-0-29"·href="#__codelineno-0-29"></a>|·-····assert·2·&lt;=·snapshot(5)·················································|
1117 <a·id="__codelineno-0-30"·name="__codelineno-0-30"·href="#__codelineno-0-30"></a>|·+····assert·2·&lt;=·snapshot(2)·················································|1117 <a·id="__codelineno-0-30"·name="__codelineno-0-30"·href="#__codelineno-0-30"></a>|·+····assert·2·&lt;=·snapshot(2)·················································|
1118 <a·id="__codelineno-0-31"·name="__codelineno-0-31"·href="#__codelineno-0-31"></a>+------------------------------------------------------------------------------+1118 <a·id="__codelineno-0-31"·name="__codelineno-0-31"·href="#__codelineno-0-31"></a>+------------------------------------------------------------------------------+
1119 <a·id="__codelineno-0-32"·name="__codelineno-0-32"·href="#__codelineno-0-32"></a>do·you·want·to·trim·these·snapshots?·[y/n]·(n):·1119 <a·id="__codelineno-0-32"·name="__codelineno-0-32"·href="#__codelineno-0-32"></a>do·you·want·to·trim·these·snapshots?·[y/n]·(n):·
1120 <a·id="__codelineno-0-33"·name="__codelineno-0-33"·href="#__codelineno-0-33"></a>1120 <a·id="__codelineno-0-33"·name="__codelineno-0-33"·href="#__codelineno-0-33"></a>
1121 <a·id="__codelineno-0-34"·name="__codelineno-0-34"·href="#__codelineno-0-34"></a>\x1b[32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·0.25s\x1b[0m\x1b[32m·===============================\x1b[0m1121 <a·id="__codelineno-0-34"·name="__codelineno-0-34"·href="#__codelineno-0-34"></a>\x1b[32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·0.41s\x1b[0m\x1b[32m·===============================\x1b[0m
1122 </code></pre></div>1122 </code></pre></div>
1123 <h2·id="-inline-snapshotdisable">--inline-snapshot=disable<a·class="headerlink"·href="#-inline-snapshotdisable"·title="Permanent·link">&para;</a></h2>1123 <h2·id="-inline-snapshotdisable">--inline-snapshot=disable<a·class="headerlink"·href="#-inline-snapshotdisable"·title="Permanent·link">&para;</a></h2>
1124 <p>Disables·all·the·snapshot·logic.·<code>snapshot(x)</code>·will·just·return·<code>x</code>.1124 <p>Disables·all·the·snapshot·logic.·<code>snapshot(x)</code>·will·just·return·<code>x</code>.
1125 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.</p>1125 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.</p>
1126 <div·class="admonition·info">1126 <div·class="admonition·info">
1127 <p·class="admonition-title">deprecation</p>1127 <p·class="admonition-title">deprecation</p>
1128 <p>This·option·was·previously·called·<code>--inline-snapshot-disable</code></p>1128 <p>This·option·was·previously·called·<code>--inline-snapshot-disable</code></p>
5.86 KB
html2text {}
    
Offset 66, 17 lines modifiedOffset 66, 17 lines modified
66 def·test_something():66 def·test_something():
67 ····assert·1·==·snapshot()67 ····assert·1·==·snapshot()
68 ····assert·2·<=·snapshot(5)68 ····assert·2·<=·snapshot(5)
69 [1;34m>·pytest·test_something.py·--inline-snapshot=create,report69 [1;34m>·pytest·test_something.py·--inline-snapshot=create,report
70 [0m\x1b[1m=============================·test·session·starts70 [0m\x1b[1m=============================·test·session·starts
71 ==============================\x1b[0m71 ==============================\x1b[0m
72 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.072 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
73 rootdir:·/tmp/tmp.kFFW8kHLKp 
74 plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0, 
75 pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.073 rootdir:·/tmp/tmp.60FAWnReg3
 74 plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-
 75 6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
76 collected·1·item76 collected·1·item
  
77 test_something.py·\x1b[32m.\x1b[0m\x1b[32m77 test_something.py·\x1b[32m.\x1b[0m\x1b[32m
78 [100%]\x1b[0m78 [100%]\x1b[0m
79 ===============================·inline·snapshot79 ===============================·inline·snapshot
80 ================================80 ================================
81 ───────────────────────────────·Create·snapshots81 ───────────────────────────────·Create·snapshots
Offset 124, 25 lines modifiedOffset 124, 25 lines modified
124 +------------------------------------------------------------------------------124 +------------------------------------------------------------------------------
125 +125 +
126 These·changes·are·not·applied.126 These·changes·are·not·applied.
127 Use·--inline-snapshot=trim·to·apply·them,·or·use·the·interactive·mode·with127 Use·--inline-snapshot=trim·to·apply·them,·or·use·the·interactive·mode·with
128 --inline-snapshot=review128 --inline-snapshot=review
  
  
129 [32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·0.25s\x1b[0m\x1b[32m129 [32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·2.10s\x1b[0m\x1b[32m
130 ===============================\x1b[0m130 ===============================\x1b[0m
131 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=s\x8sh\x8ho\x8or\x8rt\x8t-\x8-r\x8re\x8ep\x8po\x8or\x8rt\x8t_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*131 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=s\x8sh\x8ho\x8or\x8rt\x8t-\x8-r\x8re\x8ep\x8po\x8or\x8rt\x8t_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*
132 give·a·short·report·over·which·changes·can·be·made·to·the·snapshots132 give·a·short·report·over·which·changes·can·be·made·to·the·snapshots
133 [1;34m>·pytest·test_something.py·--inline-snapshot=short-report133 [1;34m>·pytest·test_something.py·--inline-snapshot=short-report
134 [0m\x1b[1m=============================·test·session·starts134 [0m\x1b[1m=============================·test·session·starts
135 ==============================\x1b[0m135 ==============================\x1b[0m
136 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0136 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
137 rootdir:·/tmp/tmp.WxEiV9suHD 
138 plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0, 
139 pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0137 rootdir:·/tmp/tmp.wduPXdW8gH
 138 plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-
 139 6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
140 collected·1·item140 collected·1·item
  
141 test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m141 test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m
142 [100%]\x1b[0m142 [100%]\x1b[0m
  
143 ====================================·ERRORS143 ====================================·ERRORS
144 ====================================144 ====================================
Offset 156, 28 lines modifiedOffset 156, 28 lines modified
  
156 You·can·also·use·--inline-snapshot=review·to·approve·the·changes·interactively156 You·can·also·use·--inline-snapshot=review·to·approve·the·changes·interactively
157 [36m\x1b[1m===========================·short·test·summary·info157 [36m\x1b[1m===========================·short·test·summary·info
158 ============================\x1b[0m158 ============================\x1b[0m
159 [31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot159 [31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot
160 is·missing·one·value.160 is·missing·one·value.
161 [31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in161 [31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in
162 0.22s\x1b[0m\x1b[31m·==========================\x1b[0m162 1.37s\x1b[0m\x1b[31m·==========================\x1b[0m
163 Info163 Info
164 short-report·exists·mainly·to·show·that·snapshots·have·changed·with·enabled164 short-report·exists·mainly·to·show·that·snapshots·have·changed·with·enabled
165 pytest·assert-rewriting.·This·option·will·be·replaced·with·r\x8re\x8ep\x8po\x8or\x8rt\x8t·when·this165 pytest·assert-rewriting.·This·option·will·be·replaced·with·r\x8re\x8ep\x8po\x8or\x8rt\x8t·when·this
166 restriction·is·lifted.166 restriction·is·lifted.
167 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=r\x8re\x8ep\x8po\x8or\x8rt\x8t_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*167 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=r\x8re\x8ep\x8po\x8or\x8rt\x8t_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*
168 Shows·a·diff·report·over·which·changes·can·be·made·to·the·snapshots168 Shows·a·diff·report·over·which·changes·can·be·made·to·the·snapshots
169 [1;34m>·pytest·test_something.py·--inline-snapshot=report169 [1;34m>·pytest·test_something.py·--inline-snapshot=report
170 [0m\x1b[1m=============================·test·session·starts170 [0m\x1b[1m=============================·test·session·starts
171 ==============================\x1b[0m171 ==============================\x1b[0m
172 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0172 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
173 rootdir:·/tmp/tmp.pvYajNAczw 
174 plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0, 
175 pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0173 rootdir:·/tmp/tmp.cu7h0QkmhQ
 174 plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-
 175 6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
176 collected·1·item176 collected·1·item
  
177 test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m177 test_something.py·\x1b[32m.\x1b[0m\x1b[31mE\x1b[0m\x1b[31m
178 [100%]\x1b[0m178 [100%]\x1b[0m
  
179 ====================================·ERRORS179 ====================================·ERRORS
180 ====================================180 ====================================
Offset 237, 24 lines modifiedOffset 237, 24 lines modified
237 --inline-snapshot=review237 --inline-snapshot=review
  
238 [36m\x1b[1m===========================·short·test·summary·info238 [36m\x1b[1m===========================·short·test·summary·info
239 ============================\x1b[0m239 ============================\x1b[0m
240 [31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot240 [31mERROR\x1b[0m·test_something.py::\x1b[1mtest_something\x1b[0m·-·Failed:·your·snapshot
241 is·missing·one·value.241 is·missing·one·value.
242 [31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in242 [31m==========================·\x1b[32m1·passed\x1b[0m,·\x1b[31m\x1b[1m1·error\x1b[0m\x1b[31m·in
243 0.23s\x1b[0m\x1b[31m·==========================\x1b[0m243 0.56s\x1b[0m\x1b[31m·==========================\x1b[0m
244 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=r\x8re\x8ev\x8vi\x8ie\x8ew\x8w_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*244 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=r\x8re\x8ev\x8vi\x8ie\x8ew\x8w_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*
245 Shows·a·diff·report·for·each·category·and·ask·if·you·want·to·apply·the·changes245 Shows·a·diff·report·for·each·category·and·ask·if·you·want·to·apply·the·changes
246 [1;34m>·pytest·test_something.py·--inline-snapshot=review246 [1;34m>·pytest·test_something.py·--inline-snapshot=review
247 [0m\x1b[1m=============================·test·session·starts247 [0m\x1b[1m=============================·test·session·starts
248 ==============================\x1b[0m248 ==============================\x1b[0m
249 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0249 platform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0
250 rootdir:·/tmp/tmp.9CRz6fCaz7 
251 plugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0, 
252 pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0250 rootdir:·/tmp/tmp.aKuOS0UTRs
 251 plugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-
 252 6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0
253 collected·1·item253 collected·1·item
  
254 test_something.py·\x1b[32m.\x1b[0m\x1b[32m254 test_something.py·\x1b[32m.\x1b[0m\x1b[32m
255 [100%]\x1b[0m255 [100%]\x1b[0m
256 ===============================·inline·snapshot256 ===============================·inline·snapshot
257 ================================257 ================================
258 ───────────────────────────────·Create·snapshots258 ───────────────────────────────·Create·snapshots
Offset 298, 15 lines modifiedOffset 298, 15 lines modified
298 |298 |
299 |·+····assert·2·<=·snapshot(2)299 |·+····assert·2·<=·snapshot(2)
300 |300 |
301 +------------------------------------------------------------------------------301 +------------------------------------------------------------------------------
302 +302 +
303 do·you·want·to·trim·these·snapshots?·[y/n]·(n):303 do·you·want·to·trim·these·snapshots?·[y/n]·(n):
  
304 [32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·0.25s\x1b[0m\x1b[32m304 [32m==============================·\x1b[32m\x1b[1m1·passed\x1b[0m\x1b[32m·in·0.41s\x1b[0m\x1b[32m
305 ===============================\x1b[0m305 ===============================\x1b[0m
306 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=d\x8di\x8is\x8sa\x8ab\x8bl\x8le\x8e_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*306 *\x8**\x8**\x8**\x8**\x8*·-\x8--\x8-i\x8in\x8nl\x8li\x8in\x8ne\x8e-\x8-s\x8sn\x8na\x8ap\x8ps\x8sh\x8ho\x8ot\x8t=\x8=d\x8di\x8is\x8sa\x8ab\x8bl\x8le\x8e_\x8?\x8·*\x8**\x8**\x8**\x8**\x8*
307 Disables·all·the·snapshot·logic.·snapshot(x)·will·just·return·x.·This·can·be307 Disables·all·the·snapshot·logic.·snapshot(x)·will·just·return·x.·This·can·be
308 used·if·you·think·exclude·that·snapshot·logic·causes·a·problem·in·your·tests,308 used·if·you·think·exclude·that·snapshot·logic·causes·a·problem·in·your·tests,
309 or·if·you·want·to·speedup·your·CI.309 or·if·you·want·to·speedup·your·CI.
310 deprecation310 deprecation
311 This·option·was·previously·called·--inline-snapshot-disable311 This·option·was·previously·called·--inline-snapshot-disable
71.0 KB
./usr/share/doc/python-inline-snapshot-doc/html/search/search_index.json
70.9 KB
Pretty-printed
Similarity: 0.9968507751937986% Differences: {"'docs'": "{133: {'text': '<p>Uses <code>contextlib.redirect_stderr/stdout</code> to capture the " 'output and compare it with the snapshots. <code>dirty_equals.IsStr</code> can be used ' 'to ignore the output if needed.</p> <p>Parameters:</p> Name Type Description Default ' '<code>stdout</code> <code>Snapshot[str]</code> <p>snapshot which is compared to the ' "recorded output</p> <code>\\'\\'</code> <code>stderr</code> <code>Snapshot[str]</code> " "<p […]
    
Offset 672, 25 lines modifiedOffset 672, 25 lines modified
672 ········{672 ········{
673 ············"location":·"extra.html#inline_snapshot.extra",673 ············"location":·"extra.html#inline_snapshot.extra",
674 ············"text":·"<p>The·following·functions·are·build·on·top·of·inline-snapshot·and·could·also·be·implemented·in·an·extra·library.</p>·<p>They·are·part·of·inline-snapshot·because·they·are·general·useful·and·do·not·depend·on·other·libraries.</p>",674 ············"text":·"<p>The·following·functions·are·build·on·top·of·inline-snapshot·and·could·also·be·implemented·in·an·extra·library.</p>·<p>They·are·part·of·inline-snapshot·because·they·are·general·useful·and·do·not·depend·on·other·libraries.</p>",
675 ············"title":·"<code>inline_snapshot.extra</code>"675 ············"title":·"<code>inline_snapshot.extra</code>"
676 ········},676 ········},
677 ········{677 ········{
678 ············"location":·"extra.html#inline_snapshot.extra.prints",678 ············"location":·"extra.html#inline_snapshot.extra.prints",
679 ············"text":·"<p>Uses·<code>contextlib.redirect_stderr/stdout</code>·to·capture·the·output·and·compare·it·with·the·snapshots.·<code>dirty_equals.IsStr</code>·can·be·used·to·ignore·the·output·if·needed.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>stdout</code>·<code>Snapshot[str]</code>·<p>snapshot·which·is·compared·to·the·recorded·output</p>·<code>''</code>·<code>stderr</code>·<code>Snapshot[str]</code>·<p>snapshot·which·is·compared·to·the·recorded·error·output</p>·<code>''</code>·original--inline-snapshot=createignore·stdout·<p>·<pre><code>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</code></pre></p>·<p>·<pre><code>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</code></pre></p>·<p>·<pre><code>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</code></pre></p>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py</code>·<pre><code>@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········&lt;!--·inline-snapshot:·first_block·outcome-passed=1·outcome-errors=1·--&gt;\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········&lt;!--·inline-snapshot:·create·outcome-passed=1·--&gt;\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········&lt;!--·inline-snapshot:·outcome-passed=1·--&gt;\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</code></pre>",679 ············"text":·"<p>Uses·<code>contextlib.redirect_stderr/stdout</code>·to·capture·the·output·and·compare·it·with·the·snapshots.·<code>dirty_equals.IsStr</code>·can·be·used·to·ignore·the·output·if·needed.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>stdout</code>·<code>Snapshot[str]</code>·<p>snapshot·which·is·compared·to·the·recorded·output</p>·<code>''</code>·<code>stderr</code>·<code>Snapshot[str]</code>·<p>snapshot·which·is·compared·to·the·recorded·error·output</p>·<code>''</code>·original--inline-snapshot=createignore·stdout·<p>·<pre><code>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</code></pre></p>·<p>·<pre><code>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</code></pre></p>·<p>·<pre><code>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</code></pre></p>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py</code>·<pre><code>@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········&lt;!--·inline-snapshot:·first_block·outcome-passed=1·outcome-errors=1·--&gt;\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········&lt;!--·inline-snapshot:·create·outcome-passed=1·--&gt;\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········&lt;!--·inline-snapshot:·outcome-passed=1·--&gt;\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</code></pre>",
680 ············"title":·"<code>prints(*,·stdout='',·stderr='')</code>"680 ············"title":·"<code>prints(*,·stdout='',·stderr='')</code>"
681 ········},681 ········},
682 ········{682 ········{
683 ············"location":·"extra.html#inline_snapshot.extra.raises",683 ············"location":·"extra.html#inline_snapshot.extra.raises",
684 ············"text":·"<p>Check·that·an·exception·is·raised.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>exception</code>·<code>Snapshot[str]</code>·<p>snapshot·which·is·compared·with·<code>f\"{type}:·{message}\"</code>·if·an·exception·occured·or·<code>\"&lt;no·exception&gt;\"</code>·if·no·exception·was·raised.</p>·required·original--inline-snapshot=create·<p>·<pre><code>from·inline_snapshot·import·snapshot\nfrom·inline_snapshot.extra·import·raises\n\n\ndef·test_raises():\n····with·raises(snapshot()):\n········1·/·0\n</code></pre></p>·<p>·<pre><code>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</code></pre></p>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py</code>·<pre><code>@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·\"&lt;no·exception&gt;\"`·if·no·exception·was·raised.\n\n····===·\"original\"\n\n········&lt;!--·inline-snapshot:·first_block·outcome-passed=1·outcome-errors=1·--&gt;\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········&lt;!--·inline-snapshot:·create·outcome-passed=1·--&gt;\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·\"&lt;no·exception&gt;\"·==·exception\n</code></pre>",684 ············"text":·"<p>Check·that·an·exception·is·raised.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>exception</code>·<code>Snapshot[str]</code>·<p>snapshot·which·is·compared·with·<code>f\"{type}:·{message}\"</code>·if·an·exception·occured·or·<code>\"&lt;no·exception&gt;\"</code>·if·no·exception·was·raised.</p>·required·original--inline-snapshot=create·<p>·<pre><code>from·inline_snapshot·import·snapshot\nfrom·inline_snapshot.extra·import·raises\n\n\ndef·test_raises():\n····with·raises(snapshot()):\n········1·/·0\n</code></pre></p>·<p>·<pre><code>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</code></pre></p>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py</code>·<pre><code>@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·\"&lt;no·exception&gt;\"`·if·no·exception·was·raised.\n\n····===·\"original\"\n\n········&lt;!--·inline-snapshot:·first_block·outcome-passed=1·outcome-errors=1·--&gt;\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········&lt;!--·inline-snapshot:·create·outcome-passed=1·--&gt;\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·\"&lt;no·exception&gt;\"·==·exception\n</code></pre>",
685 ············"title":·"<code>raises(exception)</code>"685 ············"title":·"<code>raises(exception)</code>"
686 ········},686 ········},
687 ········{687 ········{
688 ············"location":·"extra.html#inline_snapshot.extra.warns",688 ············"location":·"extra.html#inline_snapshot.extra.warns",
689 ············"text":·"<p>Captures·warnings·with·<code>warnings.catch_warnings</code>·and·compares·them·against·expected·warnings.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>expected_warnings</code>·<code>Snapshot[List[Warning]]</code>·<p>Snapshot·containing·a·list·of·expected·warnings.</p>·required·<code>include_line</code>·<code>bool</code>·<p>If·<code>True</code>,·each·expected·warning·is·a·tuple·<code>(linenumber,·message)</code>.</p>·<code>False</code>·<code>include_file</code>·<code>bool</code>·<p>If·<code>True</code>,·each·expected·warning·is·a·tuple·<code>(filename,·message)</code>.</p>·<code>False</code>·<p>The·format·of·the·expected·warning:</p>·<ul>·<li><code>(filename,·linenumber,·message)</code>·if·both·<code>include_line</code>·and·<code>include_file</code>·are·<code>True</code>.</li>·<li><code>(linenumber,·message)</code>·if·only·<code>include_line</code>·is·<code>True</code>.</li>·<li><code>(filename,·message)</code>·if·only·<code>include_file</code>·is·<code>True</code>.</li>·<li>A·string·<code>message</code>·if·both·are·<code>False</code>.</li>·</ul>·original--inline-snapshot=create·<p>·<pre><code>from·inline_snapshot·import·snapshot\nfrom·inline_snapshot.extra·import·warns\nfrom·warnings·import·warn\n\n\ndef·test_warns():\n····with·warns(snapshot(),·include_line=True):\n········warn(\"some·problem\")\n</code></pre></p>·<p>·<pre><code>from·inline_snapshot·import·snapshot\nfrom·inline_snapshot.extra·import·warns\nfrom·warnings·import·warn\n\n\ndef·test_warns():\n····with·warns(snapshot([(8,·\"UserWarning:·some·problem\")]),·include_line=True):\n········warn(\"some·problem\")\n</code></pre></p>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/extra.py</code>·<pre><code>@contextlib.contextmanager\ndef·warns(\n····expected_warnings:·Snapshot[List[Warning]],\n····/,\n····include_line:·bool·=·False,\n····include_file:·bool·=·False,\n):\n····\"\"\"\n····Captures·warnings·with·`warnings.catch_warnings`·and·compares·them·against·expected·warnings.\n\n····Parameters:\n········expected_warnings:·Snapshot·containing·a·list·of·expected·warnings.\n········include_line:·If·`True`,·each·expected·warning·is·a·tuple·`(linenumber,·message)`.\n········include_file:·If·`True`,·each·expected·warning·is·a·tuple·`(filename,·message)`.\n\n····The·format·of·the·expected·warning:\n\n····-·`(filename,·linenumber,·message)`·if·both·`include_line`·and·`include_file`·are·`True`.\n····-·`(linenumber,·message)`·if·only·`include_line`·is·`True`.\n····-·`(filename,·message)`·if·only·`include_file`·is·`True`.\n····-·A·string·`message`·if·both·are·`False`.\n\n····===·\"original\"\n\n········&lt;!--·inline-snapshot:·first_block·outcome-passed=1·outcome-errors=1·--&gt;\n········```·python\n········from·inline_snapshot·import·snapshot\n········from·inline_snapshot.extra·import·warns\n········from·warnings·import·warn\n\n\n········def·test_warns():\n············with·warns(snapshot(),·include_line=True):\n················warn(\"some·problem\")\n········```\n\n····===·\"--inline-snapshot=create\"\n\n········&lt;!--·inline-snapshot:·create·fix·outcome-passed=1·--&gt;\n········```·python·hl_lines=\"7\"\n········from·inline_snapshot·import·snapshot\n········from·inline_snapshot.extra·import·warns\n········from·warnings·import·warn\n\n\n········def·test_warns():\n············with·warns(snapshot([(8,·\"UserWarning:·some·problem\")]),·include_line=True):\n················warn(\"some·problem\")\n········```\n····\"\"\"\n····with·warnings.catch_warnings(record=True)·as·result:\n········warnings.simplefilter(\"always\")\n········yield\n\n····def·make_warning(w):\n········message·=·f\"{w.category.__name__}:·{w.message}\"\n········if·not·include_line·and·not·include_file:\n············return·message\n········message·=·(message,)\n\n········if·include_line:\n············message·=·(w.lineno,·*message)\n········if·include_file:\n············message·=·(w.filename,·*message)\n\n········return·message\n\n····assert·[make_warning(w)·for·w·in·result]·==·expected_warnings\n</code></pre>",689 ············"text":·"<p>Captures·warnings·with·<code>warnings.catch_warnings</code>·and·compares·them·against·expected·warnings.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>expected_warnings</code>·<code>Snapshot[List[Warning]]</code>·<p>Snapshot·containing·a·list·of·expected·warnings.</p>·required·<code>include_line</code>·<code>bool</code>·<p>If·<code>True</code>,·each·expected·warning·is·a·tuple·<code>(linenumber,·message)</code>.</p>·<code>False</code>·<code>include_file</code>·<code>bool</code>·<p>If·<code>True</code>,·each·expected·warning·is·a·tuple·<code>(filename,·message)</code>.</p>·<code>False</code>·<p>The·format·of·the·expected·warning:</p>·<ul>·<li><code>(filename,·linenumber,·message)</code>·if·both·<code>include_line</code>·and·<code>include_file</code>·are·<code>True</code>.</li>·<li><code>(linenumber,·message)</code>·if·only·<code>include_line</code>·is·<code>True</code>.</li>·<li><code>(filename,·message)</code>·if·only·<code>include_file</code>·is·<code>True</code>.</li>·<li>A·string·<code>message</code>·if·both·are·<code>False</code>.</li>·</ul>·original--inline-snapshot=create·<p>·<pre><code>from·inline_snapshot·import·snapshot\nfrom·inline_snapshot.extra·import·warns\nfrom·warnings·import·warn\n\n\ndef·test_warns():\n····with·warns(snapshot(),·include_line=True):\n········warn(\"some·problem\")\n</code></pre></p>·<p>·<pre><code>from·inline_snapshot·import·snapshot\nfrom·inline_snapshot.extra·import·warns\nfrom·warnings·import·warn\n\n\ndef·test_warns():\n····with·warns(snapshot([(8,·\"UserWarning:·some·problem\")]),·include_line=True):\n········warn(\"some·problem\")\n</code></pre></p>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/extra.py</code>·<pre><code>@contextlib.contextmanager\ndef·warns(\n····expected_warnings:·Snapshot[List[Warning]],\n····/,\n····include_line:·bool·=·False,\n····include_file:·bool·=·False,\n):\n····\"\"\"\n····Captures·warnings·with·`warnings.catch_warnings`·and·compares·them·against·expected·warnings.\n\n····Parameters:\n········expected_warnings:·Snapshot·containing·a·list·of·expected·warnings.\n········include_line:·If·`True`,·each·expected·warning·is·a·tuple·`(linenumber,·message)`.\n········include_file:·If·`True`,·each·expected·warning·is·a·tuple·`(filename,·message)`.\n\n····The·format·of·the·expected·warning:\n\n····-·`(filename,·linenumber,·message)`·if·both·`include_line`·and·`include_file`·are·`True`.\n····-·`(linenumber,·message)`·if·only·`include_line`·is·`True`.\n····-·`(filename,·message)`·if·only·`include_file`·is·`True`.\n····-·A·string·`message`·if·both·are·`False`.\n\n····===·\"original\"\n\n········&lt;!--·inline-snapshot:·first_block·outcome-passed=1·outcome-errors=1·--&gt;\n········```·python\n········from·inline_snapshot·import·snapshot\n········from·inline_snapshot.extra·import·warns\n········from·warnings·import·warn\n\n\n········def·test_warns():\n············with·warns(snapshot(),·include_line=True):\n················warn(\"some·problem\")\n········```\n\n····===·\"--inline-snapshot=create\"\n\n········&lt;!--·inline-snapshot:·create·fix·outcome-passed=1·--&gt;\n········```·python·hl_lines=\"7\"\n········from·inline_snapshot·import·snapshot\n········from·inline_snapshot.extra·import·warns\n········from·warnings·import·warn\n\n\n········def·test_warns():\n············with·warns(snapshot([(8,·\"UserWarning:·some·problem\")]),·include_line=True):\n················warn(\"some·problem\")\n········```\n····\"\"\"\n····with·warnings.catch_warnings(record=True)·as·result:\n········warnings.simplefilter(\"always\")\n········yield\n\n····def·make_warning(w):\n········message·=·f\"{w.category.__name__}:·{w.message}\"\n········if·not·include_line·and·not·include_file:\n············return·message\n········message·=·(message,)\n\n········if·include_line:\n············message·=·(w.lineno,·*message)\n········if·include_file:\n············message·=·(w.filename,·*message)\n\n········return·message\n\n····assert·[make_warning(w)·for·w·in·result]·==·expected_warnings\n</code></pre>",
690 ············"title":·"<code>warns(expected_warnings,·/,·include_line=False,·include_file=False)</code>"690 ············"title":·"<code>warns(expected_warnings,·/,·include_line=False,·include_file=False)</code>"
691 ········},691 ········},
692 ········{692 ········{
693 ············"location":·"getitem_snapshot.html",693 ············"location":·"getitem_snapshot.html",
694 ············"text":·"",694 ············"text":·"",
695 ············"title":·"snapshot()[key]"695 ············"title":·"snapshot()[key]"
696 ········},696 ········},
Offset 752, 65 lines modifiedOffset 752, 65 lines modified
752 ········{752 ········{
753 ············"location":·"outsource.html#api",753 ············"location":·"outsource.html#api",
754 ············"text":·"",754 ············"text":·"",
755 ············"title":·"API"755 ············"title":·"API"
756 ········},756 ········},
757 ········{757 ········{
758 ············"location":·"outsource.html#inline_snapshot.outsource",758 ············"location":·"outsource.html#inline_snapshot.outsource",
759 ············"text":·"<p>Outsource·some·data·into·an·external·file.</p>·<pre><code>&gt;&gt;&gt;·png_data·=·b\"some_bytes\"··#·should·be·the·replaced·with·your·actual·data\n&gt;&gt;&gt;·outsource(png_data,·suffix=\".png\")\nexternal(\"212974ed1835*.png\")\n</code></pre>·<p>Parameters:</p>·Name·Type·Description·Default·<code>data</code>·<code>Union[str,·bytes]</code>·<p>data·which·should·be·outsourced.·strings·are·encoded·with·<code>\"utf-8\"</code>.</p>·required·<code>suffix</code>·<code>Optional[str]</code>·<p>overwrite·file·suffix.·The·default·is·<code>\".bin\"</code>·if·data·is·an·instance·of·<code>bytes</code>·and·<code>\".txt\"</code>·for·<code>str</code>.</p>·<code>None</code>·<p>Returns:</p>·Type·Description·<code>external</code>·<p>The·external·data.</p>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>def·outsource(data:·Union[str,·bytes],·*,·suffix:·Optional[str]·=·None)·-&gt;·external:\n····\"\"\"Outsource·some·data·into·an·external·file.\n\n····```·pycon\n····&gt;&gt;&gt;·png_data·=·b\"some_bytes\"··#·should·be·the·replaced·with·your·actual·data\n····&gt;&gt;&gt;·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</code></pre>",759 ············"text":·"<p>Outsource·some·data·into·an·external·file.</p>·<pre><code>&gt;&gt;&gt;·png_data·=·b\"some_bytes\"··#·should·be·the·replaced·with·your·actual·data\n&gt;&gt;&gt;·outsource(png_data,·suffix=\".png\")\nexternal(\"212974ed1835*.png\")\n</code></pre>·<p>Parameters:</p>·Name·Type·Description·Default·<code>data</code>·<code>Union[str,·bytes]</code>·<p>data·which·should·be·outsourced.·strings·are·encoded·with·<code>\"utf-8\"</code>.</p>·required·<code>suffix</code>·<code>Optional[str]</code>·<p>overwrite·file·suffix.·The·default·is·<code>\".bin\"</code>·if·data·is·an·instance·of·<code>bytes</code>·and·<code>\".txt\"</code>·for·<code>str</code>.</p>·<code>None</code>·<p>Returns:</p>·Type·Description·<code>external</code>·<p>The·external·data.</p>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>def·outsource(data:·Union[str,·bytes],·*,·suffix:·Optional[str]·=·None)·-&gt;·external:\n····\"\"\"Outsource·some·data·into·an·external·file.\n\n····```·pycon\n····&gt;&gt;&gt;·png_data·=·b\"some_bytes\"··#·should·be·the·replaced·with·your·actual·data\n····&gt;&gt;&gt;·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</code></pre>",
760 ············"title":·"<code>inline_snapshot.outsource(data,·*,·suffix=None)</code>"760 ············"title":·"<code>inline_snapshot.outsource(data,·*,·suffix=None)</code>"
761 ········},761 ········},
762 ········{762 ········{
763 ············"location":·"outsource.html#inline_snapshot.external",763 ············"location":·"outsource.html#inline_snapshot.external",
764 ············"text":·"Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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·by·default·stored·inside·`&lt;pytest_config_dir&gt;/.inline-snapshot/external`,\n········where·`&lt;pytest_config_dir&gt;`·is·replaced·by·the·directory·containing·the·Pytest·configuration·file,·if·any.\n········To·store·data·in·a·different·location,·set·the·`storage-dir`·option·in·pyproject.toml.\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·&lt;hash&gt;.&lt;suffix&gt;·or·&lt;partial_hash&gt;*.&lt;suffix&gt;\"\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</code></pre>",764 ············"text":·"Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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·by·default·stored·inside·`&lt;pytest_config_dir&gt;/.inline-snapshot/external`,\n········where·`&lt;pytest_config_dir&gt;`·is·replaced·by·the·directory·containing·the·Pytest·configuration·file,·if·any.\n········To·store·data·in·a·different·location,·set·the·`storage-dir`·option·in·pyproject.toml.\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·&lt;hash&gt;.&lt;suffix&gt;·or·&lt;partial_hash&gt;*.&lt;suffix&gt;\"\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</code></pre>",
765 ············"title":·"<code>inline_snapshot.external</code>"765 ············"title":·"<code>inline_snapshot.external</code>"
766 ········},766 ········},
767 ········{767 ········{
768 ············"location":·"outsource.html#inline_snapshot.external.__eq__",768 ············"location":·"outsource.html#inline_snapshot.external.__eq__",
769 ············"text":·"<p>Two·external·objects·are·equal·if·they·have·the·same·hash·and·suffix.</p>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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</code></pre>",769 ············"text":·"<p>Two·external·objects·are·equal·if·they·have·the·same·hash·and·suffix.</p>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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</code></pre>",
770 ············"title":·"<code>__eq__(other)</code>"770 ············"title":·"<code>__eq__(other)</code>"
771 ········},771 ········},
772 ········{772 ········{
773 ············"location":·"outsource.html#inline_snapshot.external.__init__",773 ············"location":·"outsource.html#inline_snapshot.external.__init__",
774 ············"text":·"<p>External·objects·are·used·as·a·representation·for·outsourced·data.·You·should·not·create·them·directly.</p>·<p>The·external·data·is·by·default·stored·inside·<code>&lt;pytest_config_dir&gt;/.inline-snapshot/external</code>,·where·<code>&lt;pytest_config_dir&gt;</code>·is·replaced·by·the·directory·containing·the·Pytest·configuration·file,·if·any.·To·store·data·in·a·different·location,·set·the·<code>storage-dir</code>·option·in·pyproject.toml.·Data·which·is·outsourced·but·not·referenced·in·the·source·code·jet·has·a·'-new'·suffix·in·the·filename.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>name</code>·<code>str</code>·<p>the·name·of·the·external·stored·object.</p>·required·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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·by·default·stored·inside·`&lt;pytest_config_dir&gt;/.inline-snapshot/external`,\n····where·`&lt;pytest_config_dir&gt;`·is·replaced·by·the·directory·containing·the·Pytest·configuration·file,·if·any.\n····To·store·data·in·a·different·location,·set·the·`storage-dir`·option·in·pyproject.toml.\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·&lt;hash&gt;.&lt;suffix&gt;·or·&lt;partial_hash&gt;*.&lt;suffix&gt;\"\n········)\n</code></pre>",774 ············"text":·"<p>External·objects·are·used·as·a·representation·for·outsourced·data.·You·should·not·create·them·directly.</p>·<p>The·external·data·is·by·default·stored·inside·<code>&lt;pytest_config_dir&gt;/.inline-snapshot/external</code>,·where·<code>&lt;pytest_config_dir&gt;</code>·is·replaced·by·the·directory·containing·the·Pytest·configuration·file,·if·any.·To·store·data·in·a·different·location,·set·the·<code>storage-dir</code>·option·in·pyproject.toml.·Data·which·is·outsourced·but·not·referenced·in·the·source·code·jet·has·a·'-new'·suffix·in·the·filename.</p>·<p>Parameters:</p>·Name·Type·Description·Default·<code>name</code>·<code>str</code>·<p>the·name·of·the·external·stored·object.</p>·required·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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·by·default·stored·inside·`&lt;pytest_config_dir&gt;/.inline-snapshot/external`,\n····where·`&lt;pytest_config_dir&gt;`·is·replaced·by·the·directory·containing·the·Pytest·configuration·file,·if·any.\n····To·store·data·in·a·different·location,·set·the·`storage-dir`·option·in·pyproject.toml.\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·&lt;hash&gt;.&lt;suffix&gt;·or·&lt;partial_hash&gt;*.&lt;suffix&gt;\"\n········)\n</code></pre>",
775 ············"title":·"<code>__init__(name)</code>"775 ············"title":·"<code>__init__(name)</code>"
776 ········},776 ········},
777 ········{777 ········{
778 ············"location":·"outsource.html#inline_snapshot.external.__repr__",778 ············"location":·"outsource.html#inline_snapshot.external.__repr__",
779 ············"text":·"<p>Returns·the·representation·of·the·external·object.</p>·<p>The·length·of·the·hash·can·be·specified·in·the·config.</p>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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</code></pre>",779 ············"text":·"<p>Returns·the·representation·of·the·external·object.</p>·<p>The·length·of·the·hash·can·be·specified·in·the·config.</p>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_external.py</code>·<pre><code>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</code></pre>",
780 ············"title":·"<code>__repr__()</code>"780 ············"title":·"<code>__repr__()</code>"
781 ········},781 ········},
782 ········{782 ········{
783 ············"location":·"outsource.html#pytest-options",783 ············"location":·"outsource.html#pytest-options",
784 ············"text":·"<p>It·interacts·with·the·following·<code>--inline-snapshot</code>·flags:</p>·<ul>·<li><code>trim</code>·removes·every·snapshots·form·the·storage·which·is·not·referenced·with·<code>external(...)</code>·in·the·code.</li>·</ul>",784 ············"text":·"<p>It·interacts·with·the·following·<code>--inline-snapshot</code>·flags:</p>·<ul>·<li><code>trim</code>·removes·every·snapshots·form·the·storage·which·is·not·referenced·with·<code>external(...)</code>·in·the·code.</li>·</ul>",
785 ············"title":·"pytest·options"785 ············"title":·"pytest·options"
786 ········},786 ········},
787 ········{787 ········{
788 ············"location":·"pytest.html",788 ············"location":·"pytest.html",
789 ············"text":·"<p>inline-snapshot·provides·one·pytest·option·with·different·flags·(create,·fix,·trim,·update,·short-report,·report,·disable).</p>·<p>Snapshot·comparisons·return·always·<code>True</code>·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:</p>·<pre><code>from·inline_snapshot·import·snapshot\n\n\ndef·test_something():\n····assert·1·==·snapshot(5)\n····assert·2·&lt;=·snapshot(5)\n</code></pre>·<p>Note</p>·<p>Every·flag·with·the·exception·of·disable·and·short-report·disables·the·pytest·assert-rewriting.</p>",789 ············"text":·"<p>inline-snapshot·provides·one·pytest·option·with·different·flags·(create,·fix,·trim,·update,·short-report,·report,·disable).</p>·<p>Snapshot·comparisons·return·always·<code>True</code>·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:</p>·<pre><code>from·inline_snapshot·import·snapshot\n\n\ndef·test_something():\n····assert·1·==·snapshot(5)\n····assert·2·&lt;=·snapshot(5)\n</code></pre>·<p>Note</p>·<p>Every·flag·with·the·exception·of·disable·and·short-report·disables·the·pytest·assert-rewriting.</p>",
790 ············"title":·"pytest·integration"790 ············"title":·"pytest·integration"
791 ········},791 ········},
792 ········{792 ········{
793 ············"location":·"pytest.html#-inline-snapshotcreatefixtrimupdate",793 ············"location":·"pytest.html#-inline-snapshotcreatefixtrimupdate",
794 ············"text":·"<p>Approve·the·changes·of·the·given·category.·These·flags·can·be·combined·with·report·and·review.</p>·test_something.py<pre><code>from·inline_snapshot·import·snapshot\n\n\ndef·test_something():\n····assert·1·==·snapshot()\n····assert·2·&lt;=·snapshot(5)\n</code></pre>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=create,report\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.kFFW8kHLKp\nplugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[32m·································[·...·truncated·by·diffoscope;·len:·2791,·SHA:·832957ffc5e153407fc859992e40fb842f2c78dc9ffeea69667d722fd0331ea8·...·]s\u001b[0m\u001b[32m·===============================\u001b[0m\n</code></pre>",794 ············"text":·"<p>Approve·the·changes·of·the·given·category.·These·flags·can·be·combined·with·report·and·review.</p>·test_something.py<pre><code>from·inline_snapshot·import·snapshot\n\n\ndef·test_something():\n····assert·1·==·snapshot()\n····assert·2·&lt;=·snapshot(5)\n</code></pre>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=create,report\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.60FAWnReg3\nplugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[32m·································[·...·truncated·by·diffoscope;·len:·2791,·SHA:·c5dccb141559cb390f435f8721dde35e66d398f3b8e70ac08bec34f97ca2d252·...·]s\u001b[0m\u001b[32m·===============================\u001b[0m\n</code></pre>",
795 ············"title":·"--inline-snapshot=create,fix,trim,update"795 ············"title":·"--inline-snapshot=create,fix,trim,update"
796 ········},796 ········},
797 ········{797 ········{
798 ············"location":·"pytest.html#-inline-snapshotshort-report",798 ············"location":·"pytest.html#-inline-snapshotshort-report",
799 ············"text":·"<p>give·a·short·report·over·which·changes·can·be·made·to·the·snapshots</p>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=short-report\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.WxEiV9suHD\nplugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m·············[·...·truncated·by·diffoscope;·len:·932,·SHA:·9404647b77be5accf4e0a99050bc3a88762f9f7743ba48700d473b2725e19e32·...·]s\u001b[0m\u001b[31m·==========================\u001b[0m\n</code></pre>·<p>Info</p>·<p>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.</p>",799 ············"text":·"<p>give·a·short·report·over·which·changes·can·be·made·to·the·snapshots</p>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=short-report\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.wduPXdW8gH\nplugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m·············[·...·truncated·by·diffoscope;·len:·932,·SHA:·b1748cdc5c92ffdcce269c70ac4544d58a82d32c7c346d8d1f3824b67b31c66d·...·]s\u001b[0m\u001b[31m·==========================\u001b[0m\n</code></pre>·<p>Info</p>·<p>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.</p>",
800 ············"title":·"--inline-snapshot=short-report"800 ············"title":·"--inline-snapshot=short-report"
801 ········},801 ········},
802 ········{802 ········{
803 ············"location":·"pytest.html#-inline-snapshotreport",803 ············"location":·"pytest.html#-inline-snapshotreport",
804 ············"text":·"<p>Shows·a·diff·report·over·which·changes·can·be·made·to·the·snapshots</p>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=report\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.pvYajNAczw\nplugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m·············[·...·truncated·by·diffoscope;·len:·3360,·SHA:·8a172b8cf7cb19151db5839360fc488a86838c0ef8faf99ac916d370685a1d01·...·]s\u001b[0m\u001b[31m·==========================\u001b[0m\n</code></pre>",804 ············"text":·"<p>Shows·a·diff·report·over·which·changes·can·be·made·to·the·snapshots</p>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=report\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.cu7h0QkmhQ\nplugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[31mE\u001b[0m\u001b[31m·············[·...·truncated·by·diffoscope;·len:·3360,·SHA:·ded2e05e76164a296ea4acd9cf46f488b06d193d596361cf3132e8ef906fc59b·...·]s\u001b[0m\u001b[31m·==========================\u001b[0m\n</code></pre>",
805 ············"title":·"--inline-snapshot=report"805 ············"title":·"--inline-snapshot=report"
806 ········},806 ········},
807 ········{807 ········{
808 ············"location":·"pytest.html#-inline-snapshotreview",808 ············"location":·"pytest.html#-inline-snapshotreview",
809 ············"text":·"<p>Shows·a·diff·report·for·each·category·and·ask·if·you·want·to·apply·the·changes</p>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=review\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.9CRz6fCaz7\nplugins:·hypothesis-6.122.1,·typeguard-4.4.1,·time-machine-2.16.0,·pytest_freezer-0.4.9,·inline-snapshot-0.18.1,·subtests-0.13.1,·mock-3.14.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[32m·································[·...·truncated·by·diffoscope;·len:·2680,·SHA:·524e3162457dfcb24db3082ecb32dbb4010d8a8cfa7581ef3a73bcb2d9e8fcae·...·]s\u001b[0m\u001b[32m·===============================\u001b[0m\n</code></pre>",809 ············"text":·"<p>Shows·a·diff·report·for·each·category·and·ask·if·you·want·to·apply·the·changes</p>·<pre><code>\u001b[1;34m&gt;·pytest·test_something.py·--inline-snapshot=review\n\u001b[0m\u001b[1m=============================·test·session·starts·==============================\u001b[0m\nplatform·linux·--·Python·3.12.8,·pytest-8.3.4,·pluggy-1.5.0\nrootdir:·/tmp/tmp.aKuOS0UTRs\nplugins:·mock-3.14.0,·subtests-0.13.1,·inline-snapshot-0.18.1,·hypothesis-6.122.1,·pytest_freezer-0.4.9,·typeguard-4.4.1,·time-machine-2.16.0\ncollected·1·item\n\ntest_something.py·\u001b[32m.\u001b[0m\u001b[32m·································[·...·truncated·by·diffoscope;·len:·2680,·SHA:·562ae034b9660bb05920d482667e36ea0c30a58d67127e9ad44acceac0d3e1f4·...·]s\u001b[0m\u001b[32m·===============================\u001b[0m\n</code></pre>",
810 ············"title":·"--inline-snapshot=review"810 ············"title":·"--inline-snapshot=review"
811 ········},811 ········},
812 ········{812 ········{
813 ············"location":·"pytest.html#-inline-snapshotdisable",813 ············"location":·"pytest.html#-inline-snapshotdisable",
814 ············"text":·"<p>Disables·all·the·snapshot·logic.·<code>snapshot(x)</code>·will·just·return·<code>x</code>.·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.</p>·<p>deprecation</p>·<p>This·option·was·previously·called·<code>--inline-snapshot-disable</code></p>",814 ············"text":·"<p>Disables·all·the·snapshot·logic.·<code>snapshot(x)</code>·will·just·return·<code>x</code>.·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.</p>·<p>deprecation</p>·<p>This·option·was·previously·called·<code>--inline-snapshot-disable</code></p>",
815 ············"title":·"--inline-snapshot=disable"815 ············"title":·"--inline-snapshot=disable"
816 ········},816 ········},
Offset 862, 12 lines modifiedOffset 862, 12 lines modified
862 ········{862 ········{
863 ············"location":·"types.html#inline_snapshot.Category",863 ············"location":·"types.html#inline_snapshot.Category",
864 ············"text":·"<p>See·categories</p>",864 ············"text":·"<p>See·categories</p>",
865 ············"title":·"<code>Category·=·Literal['update',·'fix',·'create',·'trim']</code>··<code>module-attribute</code>"865 ············"title":·"<code>Category·=·Literal['update',·'fix',·'create',·'trim']</code>··<code>module-attribute</code>"
866 ········},866 ········},
867 ········{867 ········{
868 ············"location":·"types.html#inline_snapshot.Snapshot",868 ············"location":·"types.html#inline_snapshot.Snapshot",
869 ············"text":·"<p>Can·be·used·to·annotate·function·arguments·which·accept·snapshot·values.</p>·<p>You·can·annotate·function·arguments·with·<code>Snapshot[T]</code>·to·declare·that·a·snapshot-value·can·be·passed·as·function·argument.·<code>Snapshot[T]</code>·is·a·type·alias·for·<code>T</code>,·which·allows·you·to·pass·<code>int</code>·values·instead·of·<code>int</code>·snapshots.</p>·<p>Example:</p>·<pre><code>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·&lt;=·value·&lt;=·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</code></pre>·Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_types.py</code>·<pre><code>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····&lt;!--·inline-snapshot:·create·fix·trim·first_block·outcome-passed=2·--&gt;\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·&lt;=·value·&lt;=·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</code></pre>",869 ············"text":·"<p>Can·be·used·to·annotate·function·arguments·which·accept·snapshot·values.</p>·<p>You·can·annotate·function·arguments·with·<code>Snapshot[T]</code>·to·declare·that·a·snapshot-value·can·be·passed·as·function·argument.·<code>Snapshot[T]</code>·is·a·type·alias·for·<code>T</code>,·which·allows·you·to·pass·<code>int</code>·values·instead·of·<code>int</code>·snapshots.</p>·<p>Example:</p>·<pre><code>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·&lt;=·value·&lt;=·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</code></pre>·Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_types.py</code>·<pre><code>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····&lt;!--·inline-snapshot:·create·fix·trim·first_block·outcome-passed=2·--&gt;\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·&lt;=·value·&lt;=·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</code></pre>",
870 ············"title":·"<code>Snapshot</code>"870 ············"title":·"<code>Snapshot</code>"
871 ········}871 ········}
872 ····]872 ····]
873 }873 }
1.7 KB
./usr/share/doc/python-inline-snapshot-doc/html/types.html
    
Offset 1001, 15 lines modifiedOffset 1001, 15 lines modified
  
  
  
  
  
  
1001 ··············<details·class="quote">1001 ··············<details·class="quote">
1002 ················<summary>Source·code·in·<code>.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/_types.py</code></summary>1002 ················<summary>Source·code·in·<code>.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/_types.py</code></summary>
1003 ················<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-21">21</a></span>1003 ················<div·class="highlight"><table·class="highlighttable"><tr><td·class="linenos"><div·class="linenodiv"><pre><span></span><span·class="normal"><a·href="#__codelineno-0-21">21</a></span>
1004 <span·class="normal"><a·href="#__codelineno-0-22">22</a></span>1004 <span·class="normal"><a·href="#__codelineno-0-22">22</a></span>
1005 <span·class="normal"><a·href="#__codelineno-0-23">23</a></span>1005 <span·class="normal"><a·href="#__codelineno-0-23">23</a></span>
1006 <span·class="normal"><a·href="#__codelineno-0-24">24</a></span>1006 <span·class="normal"><a·href="#__codelineno-0-24">24</a></span>
1007 <span·class="normal"><a·href="#__codelineno-0-25">25</a></span>1007 <span·class="normal"><a·href="#__codelineno-0-25">25</a></span>
1008 <span·class="normal"><a·href="#__codelineno-0-26">26</a></span>1008 <span·class="normal"><a·href="#__codelineno-0-26">26</a></span>
1009 <span·class="normal"><a·href="#__codelineno-0-27">27</a></span>1009 <span·class="normal"><a·href="#__codelineno-0-27">27</a></span>
690 B
html2text {}
    
Offset 78, 15 lines modifiedOffset 78, 15 lines modified
78 ········assert·len(value)·==·length78 ········assert·len(value)·==·length
  
  
79 def·test_container():79 def·test_container():
80 ····check_container([1,·2],·value_repr=snapshot("[1,·2]"),·length=snapshot(2))80 ····check_container([1,·2],·value_repr=snapshot("[1,·2]"),·length=snapshot(2))
  
81 ····check_container({1,·1},·length=snapshot(1))81 ····check_container({1,·1},·length=snapshot(1))
82 Source·code·in·.pybuild/cpython3_3.13_inline-snapshot/build/inline_snapshot/82 Source·code·in·.pybuild/cpython3_3.12_inline-snapshot/build/inline_snapshot/
83 _types.py83 _types.py
84 ···class·Snapshot(Generic[T]):84 ···class·Snapshot(Generic[T]):
85 _\x82_\x81·····"""Can·be·used·to·annotate·function·arguments·which·accept·snapshot85 _\x82_\x81·····"""Can·be·used·to·annotate·function·arguments·which·accept·snapshot
86 _\x82_\x82·····values.86 _\x82_\x82·····values.
87 _\x82_\x8387 _\x82_\x83
88 _\x82_\x84·····You·can·annotate·function·arguments·with·`Snapshot[T]`·to·declare·that·a88 _\x82_\x84·····You·can·annotate·function·arguments·with·`Snapshot[T]`·to·declare·that·a
89 _\x82_\x85·snapshot-value·can·be·passed·as·function·argument.89 _\x82_\x85·snapshot-value·can·be·passed·as·function·argument.