1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947
|
import pytest
from executing import is_pytest_compatible
from inline_snapshot import snapshot
from inline_snapshot.testing import Example
def test_help_message(testdir):
result = testdir.runpytest_subprocess("--help")
# fnmatch_lines does an assertion internally
result.stdout.fnmatch_lines(["inline-snapshot:", "*--inline-snapshot*"])
def test_create(project):
project.setup(
"""\
def test_a():
assert 5==snapshot()
"""
)
result = project.run("--inline-snapshot=short-report")
result.assert_outcomes(errors=1, passed=1)
assert result.report == snapshot(
"""\
Error: one snapshot is missing a value (--inline-snapshot=create)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
result = project.run("--inline-snapshot=create")
result.assert_outcomes(passed=1, errors=1)
assert result.report == snapshot(
"""\
------------------------------- Create snapshots -------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -4,4 +4,4 @@ |
| |
| |
| |
| def test_a(): |
| - assert 5==snapshot() |
| + assert 5==snapshot(5) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used create
"""
)
assert project.source == snapshot(
"""\
def test_a():
assert 5==snapshot(5)
"""
)
def test_fix(project):
project.setup(
"""\
def test_a():
assert 5==snapshot(4)
"""
)
result = project.run("--inline-snapshot=short-report")
result.assert_outcomes(failed=1, errors=1)
assert result.report == snapshot(
"""\
Error: one snapshot has incorrect values (--inline-snapshot=fix)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
result = project.run("--inline-snapshot=fix")
result.assert_outcomes(passed=1, errors=1)
assert result.report == snapshot(
"""\
-------------------------------- Fix snapshots ---------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -4,4 +4,4 @@ |
| |
| |
| |
| def test_a(): |
| - assert 5==snapshot(4) |
| + assert 5==snapshot(5) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used fix
"""
)
assert project.source == snapshot(
"""\
def test_a():
assert 5==snapshot(5)
"""
)
def test_update(project):
project.setup(
"""\
def test_a():
assert "5" == snapshot('''5''')
"""
)
result = project.run("--inline-snapshot=short-report")
result.assert_outcomes(passed=1)
assert result.report == (
snapshot(
"""\
Info: one snapshot changed its representation (--inline-snapshot=update)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
if is_pytest_compatible()
else snapshot("")
)
result = project.run("--inline-snapshot=update")
assert result.report == snapshot(
"""\
------------------------------- Update snapshots -------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -4,4 +4,4 @@ |
| |
| |
| |
| def test_a(): |
| - assert "5" == snapshot('''5''') |
| + assert "5" == snapshot("5") |
+------------------------------------------------------------------------------+
These changes will be applied, because you used update
"""
)
assert project.source == snapshot(
"""\
def test_a():
assert "5" == snapshot("5")
"""
)
def test_trim(project):
project.setup(
"""\
def test_a():
assert 5 in snapshot([4,5])
"""
)
result = project.run("--inline-snapshot=short-report")
result.assert_outcomes(passed=1)
assert result.report == snapshot(
"""\
Info: one snapshot can be trimmed (--inline-snapshot=trim)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
result = project.run("--inline-snapshot=trim")
assert result.report == snapshot(
"""\
-------------------------------- Trim snapshots --------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -4,4 +4,4 @@ |
| |
| |
| |
| def test_a(): |
| - assert 5 in snapshot([4,5]) |
| + assert 5 in snapshot([5]) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used trim
"""
)
assert project.source == snapshot(
"""\
def test_a():
assert 5 in snapshot([5])
"""
)
def test_multiple(project):
project.setup(
"""\
def test_a():
assert "5" == snapshot('''5''')
assert 5 <= snapshot(8)
assert 5 == snapshot(4)
"""
)
result = project.run("--inline-snapshot=short-report")
result.assert_outcomes(failed=1, errors=1)
assert result.report == (
snapshot(
"""\
Error: one snapshot has incorrect values (--inline-snapshot=fix)
Info: one snapshot can be trimmed (--inline-snapshot=trim)
Info: one snapshot changed its representation (--inline-snapshot=update)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
if is_pytest_compatible()
else snapshot(
"""\
Error: one snapshot has incorrect values (--inline-snapshot=fix)
Info: one snapshot can be trimmed (--inline-snapshot=trim)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
)
result = project.run("--inline-snapshot=trim,fix")
assert result.report == snapshot(
"""\
-------------------------------- Fix snapshots ---------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -6,4 +6,4 @@ |
| |
| def test_a(): |
| assert "5" == snapshot('''5''') |
| assert 5 <= snapshot(8) |
| - assert 5 == snapshot(4) |
| + assert 5 == snapshot(5) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used fix
-------------------------------- Trim snapshots --------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -5,5 +5,5 @@ |
| |
| |
| def test_a(): |
| assert "5" == snapshot('''5''') |
| - assert 5 <= snapshot(8) |
| + assert 5 <= snapshot(5) |
| assert 5 == snapshot(5) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used trim
"""
)
assert project.source == snapshot(
"""\
def test_a():
assert "5" == snapshot('''5''')
assert 5 <= snapshot(5)
assert 5 == snapshot(5)
"""
)
@pytest.mark.no_rewriting
def test_disable_option(project):
project.setup(
"""\
def test_a():
pass
"""
)
result = project.run("--inline-snapshot=disable,fix")
assert result.stderr.str().strip() == snapshot(
"ERROR: --inline-snapshot=disable can not be combined with other flags (fix)"
)
result = project.run("--inline-snapshot=disable,review")
assert result.stderr.str().strip() == snapshot(
"ERROR: --inline-snapshot=disable can not be combined with other flags (review)"
)
def test_multiple_report(project):
project.setup(
"""\
def test_a():
assert "5" == snapshot('''5''')
assert 5 <= snapshot(8)
assert 5 == snapshot(4)
"""
)
project.pyproject(
"""
[tool.inline-snapshot]
show-updates=true
"""
)
result = project.run("--inline-snapshot=trim,report")
assert result.report == snapshot(
"""\
-------------------------------- Fix snapshots ---------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -6,4 +6,4 @@ |
| |
| def test_a(): |
| assert "5" == snapshot('''5''') |
| assert 5 <= snapshot(8) |
| - assert 5 == snapshot(4) |
| + assert 5 == snapshot(5) |
+------------------------------------------------------------------------------+
These changes are not applied.
Use --inline-snapshot=fix to apply them, or use the interactive mode with
--inline-snapshot=review
-------------------------------- Trim snapshots --------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -5,5 +5,5 @@ |
| |
| |
| def test_a(): |
| assert "5" == snapshot('''5''') |
| - assert 5 <= snapshot(8) |
| + assert 5 <= snapshot(5) |
| assert 5 == snapshot(4) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used trim
------------------------------- Update snapshots -------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -4,6 +4,6 @@ |
| |
| |
| |
| def test_a(): |
| - assert "5" == snapshot('''5''') |
| + assert "5" == snapshot("5") |
| assert 5 <= snapshot(5) |
| assert 5 == snapshot(4) |
+------------------------------------------------------------------------------+
These changes are not applied.
Use --inline-snapshot=update to apply them, or use the interactive mode with
--inline-snapshot=review
"""
)
assert project.source == snapshot(
"""\
def test_a():
assert "5" == snapshot('''5''')
assert 5 <= snapshot(5)
assert 5 == snapshot(4)
"""
)
def test_black_config(project):
project.setup(
"""\
def test_a():
assert list(range(10)) == snapshot([])
"""
)
project.format()
assert project.is_formatted()
project.pyproject(
"""
[tool.black]
line-length=50
"""
)
assert project.is_formatted()
project.run("--inline-snapshot=fix")
assert project.source == snapshot(
"""\
def test_a():
assert list(range(10)) == snapshot(
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
)
"""
)
assert project.is_formatted()
def test_disabled(project):
project.setup(
"""\
def test_a():
assert 4==snapshot(5)
"""
)
result = project.run("--inline-snapshot=disable")
result.assert_outcomes(failed=1)
result = project.run("--inline-snapshot=fix")
assert project.source == snapshot(
"""\
def test_a():
assert 4==snapshot(4)
"""
)
result = project.run("--inline-snapshot=disable")
result.assert_outcomes(passed=1)
def test_compare(project):
project.setup(
"""\
def test_a():
assert "a"==snapshot("b")
"""
)
result = project.run()
assert result.errorLines() == snapshot(
"""\
> assert "a"==snapshot("b")
E AssertionError: assert 'a' == 'b'
E \n\
E - b
E + a
"""
)
project.setup(
"""\
def test_a():
assert snapshot("b")=="a"
"""
)
result = project.run()
assert result.errorLines() == snapshot(
"""\
> assert snapshot("b")=="a"
E AssertionError: assert 'b' == 'a'
E \n\
E - a
E + b
"""
)
def test_assertion_error_loop(project):
project.setup(
"""\
for e in (1, 2):
assert e == snapshot()
"""
)
result = project.run()
assert result.errorLines() == snapshot(
"""\
E assert 2 == 1
E + where 1 = snapshot()
"""
)
def test_assertion_error_multiple(project):
project.setup(
"""\
for e in (1, 2):
assert e == snapshot(1)
"""
)
result = project.run()
assert result.errorLines() == snapshot(
"""\
E assert 2 == 1
E + where 1 = snapshot(1)
"""
)
def test_assertion_error(project):
project.setup("assert 2 == snapshot(1)")
result = project.run()
assert result.errorLines() == snapshot(
"""\
E assert 2 == 1
E + where 1 = snapshot(1)
"""
)
@pytest.mark.no_rewriting
def test_run_without_pytest(pytester):
# snapshots are deactivated by default
pytester.makepyfile(
test_file="""
from inline_snapshot import snapshot
s=snapshot([1,2])
assert isinstance(s,list)
assert s==[1,2]
"""
)
result = pytester.runpython("test_file.py")
assert result.ret == 0
def test_pytest_inlinesnapshot_auto(project):
project.setup(
"""\
def test_something():
assert 2 == snapshot(1)
"""
)
result = project.run("--inline-snapshot=review", stdin=b"y\n")
assert result.errorLines() == snapshot("")
assert result.report == snapshot(
"""\
-------------------------------- Fix snapshots ---------------------------------
+-------------------------------- test_file.py --------------------------------+
| @@ -4,4 +4,4 @@ |
| |
| |
| |
| def test_something(): |
| - assert 2 == snapshot(1) |
| + assert 2 == snapshot(2) |
+------------------------------------------------------------------------------+
Do you want to fix these snapshots? [y/n] (n):
"""
)
assert project.source == snapshot(
"""\
def test_something():
assert 2 == snapshot(2)
"""
)
def test_empty_sub_snapshot(project):
project.setup(
"""\
def test_sub_snapshot():
assert 1==snapshot({})["key"]
"""
)
project.term_columns = 160
result = project.run("--inline-snapshot=short-report")
assert result.ret == 1
if "insider" in result.errors: # pragma: no cover
assert result.errors == snapshot(
"""\
============================================================================ ERRORS ============================================================================
____________________________________________________________ ERROR at teardown of test_sub_snapshot ____________________________________________________________
your snapshot is missing one value.
============================================================== inline snapshot (insider version) ===============================================================
Error: one snapshot is missing a value (--inline-snapshot=create)
You can also use --inline-snapshot=review to approve the changes interactively
=================================================================== short test summary info ====================================================================
ERROR test_file.py::test_sub_snapshot - Failed: your snapshot is missing one value.
================================================================== 1 passed, 1 error in <time> ==================================================================
"""
)
else:
assert result.errors == snapshot(
"""\
============================================================================ ERRORS ============================================================================
____________________________________________________________ ERROR at teardown of test_sub_snapshot ____________________________________________________________
your snapshot is missing one value.
=================================================================== short test summary info ====================================================================
ERROR test_file.py::test_sub_snapshot - Failed: your snapshot is missing one value.
================================================================== 1 passed, 1 error in <time> ==================================================================
"""
)
assert result.report == snapshot(
"""\
Error: one snapshot is missing a value (--inline-snapshot=create)
You can also use --inline-snapshot=review to approve the changes interactively
"""
)
def test_persist_unknown_external(project):
project.setup(
"""\
from inline_snapshot import external, snapshot
def test_sub_snapshot():
external("123*.png")
assert 1==snapshot(2)
"""
)
result = project.run("--inline-snapshot=fix")
assert project.source == snapshot(
"""\
from inline_snapshot import external, snapshot
def test_sub_snapshot():
external("123*.png")
assert 1==snapshot(1)
"""
)
assert result.ret == 1
def test_diff_multiple_files():
Example(
{
"test_a.py": """
from inline_snapshot import snapshot
def test_a():
assert 1==snapshot(2)
""",
"test_b.py": """
from inline_snapshot import snapshot
def test_b():
assert 1==snapshot()
""",
}
).run_pytest(
["--inline-snapshot=create,fix"],
changed_files=snapshot(
{
"test_b.py": """\
from inline_snapshot import snapshot
def test_b():
assert 1==snapshot(1)
\
""",
"test_a.py": """\
from inline_snapshot import snapshot
def test_a():
assert 1==snapshot(1)
\
""",
}
),
report=snapshot(
"""\
------------------------------- Create snapshots -------------------------------
+--------------------------------- test_b.py ----------------------------------+
| @@ -2,5 +2,5 @@ |
| |
| from inline_snapshot import snapshot |
| |
| def test_b(): |
| - assert 1==snapshot() |
| + assert 1==snapshot(1) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used create
-------------------------------- Fix snapshots ---------------------------------
+--------------------------------- test_a.py ----------------------------------+
| @@ -2,5 +2,5 @@ |
| |
| from inline_snapshot import snapshot |
| |
| def test_a(): |
| - assert 1==snapshot(2) |
| + assert 1==snapshot(1) |
+------------------------------------------------------------------------------+
These changes will be applied, because you used fix\
"""
),
returncode=1,
)
def test_equal_check():
Example(
{
"test_a.py": """
from inline_snapshot import snapshot
class Thing:
def __repr__(self):
return "Thing()"
def test_a():
assert Thing()==snapshot()
""",
}
).run_inline(
["--inline-snapshot=create"],
changed_files=snapshot({}),
raises=snapshot(
"""\
UsageError:
inline-snapshot uses `copy.deepcopy` to copy objects,
but the copied object is not equal to the original one:
value = Thing()
copied_value = copy.deepcopy(value)
assert value == copied_value
Please fix the way your object is copied or your __eq__ implementation.
"""
),
)
def test_equal_check_2():
Example(
{
"test_a.py": """
from inline_snapshot import snapshot
class A:
def __eq__(self,other):
if isinstance(other,A):
return False
return NotImplemented
def __repr__(self):
return "A()"
def test_a():
assert A() == snapshot(A())
""",
}
).run_inline(
["--inline-snapshot=create"],
changed_files=snapshot({}),
raises=snapshot(
"""\
UsageError:
inline-snapshot uses `copy.deepcopy` to copy objects,
but the copied object is not equal to the original one:
value = A()
copied_value = copy.deepcopy(value)
assert value == copied_value
Please fix the way your object is copied or your __eq__ implementation.
"""
),
)
def test_unknown_flag():
Example(
"""\
def test_a():
assert 1==1
"""
).run_pytest(
["--inline-snapshot=creaigflen"],
report=snapshot(""),
returncode=snapshot(4),
stderr=snapshot("ERROR: --inline-snapshot=creaigflen is a unknown flag\n"),
)
@pytest.mark.parametrize("storage_dir", ["tests/snapshots", None])
def test_storage_dir_config(project, tmp_path, storage_dir):
# Relative path case: `tests/snapshots` (parametrized).
# Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`).
if not storage_dir:
storage_dir = tmp_path / "snapshots"
project.pyproject(
f"""
[tool.inline-snapshot]
storage-dir = {str(storage_dir)!r}
"""
)
project.setup(
"""
from inline_snapshot import outsource, snapshot
def test_outsource():
assert outsource("hello", suffix=".html") == snapshot()
"""
)
result = project.run("--inline-snapshot=create")
assert result.ret == 1
assert project.source == snapshot(
"""\
from inline_snapshot import outsource, snapshot
from inline_snapshot import external
def test_outsource():
assert outsource("hello", suffix=".html") == snapshot(external("2cf24dba5fb0*.html"))
"""
)
result = project.run("--inline-snapshot=fix")
assert result.ret == 0
assert project.storage(storage_dir) == snapshot(
["2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824.html"]
)
def test_find_pyproject_in_parent_directories():
Example(
{
"pyproject.toml": """\
[tool.inline-snapshot]
hash-length=2
""",
"project/pytest.ini": "",
"project/test_something.py": """\
from inline_snapshot import outsource,snapshot,external
def test_something():
assert outsource("test") == snapshot()
""",
}
).run_pytest(
["--rootdir", "./project", "--inline-snapshot=create"],
changed_files=snapshot(
{
"project/test_something.py": """\
from inline_snapshot import outsource,snapshot,external
def test_something():
assert outsource("test") == snapshot(external("9f*.txt"))
"""
}
),
returncode=1,
)
@pytest.mark.xfail(
not is_pytest_compatible(), reason="this works only for cpython >=3.11"
)
def test_default_report():
Example(
"""\
import pytest
from inline_snapshot import snapshot
def test_a():
assert 1==snapshot(5)
"""
).run_pytest(
report=snapshot(
"""\
-------------------------------- Fix snapshots ---------------------------------
+----------------------------- test_something.py ------------------------------+
| @@ -2,4 +2,4 @@ |
| |
| from inline_snapshot import snapshot |
| |
| def test_a(): |
| - assert 1==snapshot(5) |
| + assert 1==snapshot(1) |
+------------------------------------------------------------------------------+
These changes are not applied.
Use --inline-snapshot=fix to apply them, or use the interactive mode with
--inline-snapshot=review\
"""
),
returncode=snapshot(1),
stderr=snapshot(""),
changed_files=snapshot({}),
)
@pytest.mark.xfail(
not is_pytest_compatible(), reason="this works only for cpython >=3.11"
)
def test_default_review():
Example(
"""\
import pytest
from inline_snapshot import snapshot
def test_a():
assert 1==snapshot(5)
"""
).run_pytest(
report=snapshot(
"""\
-------------------------------- Fix snapshots ---------------------------------
+----------------------------- test_something.py ------------------------------+
| @@ -2,4 +2,4 @@ |
| |
| from inline_snapshot import snapshot |
| |
| def test_a(): |
| - assert 1==snapshot(5) |
| + assert 1==snapshot(1) |
+------------------------------------------------------------------------------+
Do you want to fix these snapshots? [y/n] (n):\
"""
),
returncode=snapshot(1),
stderr=snapshot(""),
changed_files=snapshot(
{
"test_something.py": """\
import pytest
from inline_snapshot import snapshot
def test_a():
assert 1==snapshot(1)
"""
}
),
stdin=b"y\n",
)
|