1s autopkgtest [04:08:09]: starting date and time: 2025-02-19 04:08:09+0000 2s autopkgtest [04:08:10]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 2s autopkgtest [04:08:10]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.5t3fsc02/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python-click --apt-upgrade python-inline-snapshot --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python-click/8.2.0-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-arm64-40.secgroup --name adt-plucky-arm64-python-inline-snapshot-20250219-040807-juju-7f2275-prod-proposed-migration-environment-15-c18b2f7f-68f1-439a-a575-be01ae633eaa --image adt/ubuntu-plucky-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 132s autopkgtest [04:10:20]: testbed dpkg architecture: arm64 133s autopkgtest [04:10:21]: testbed apt version: 2.9.29 133s autopkgtest [04:10:21]: @@@@@@@@@@@@@@@@@@@@ test bed setup 134s autopkgtest [04:10:22]: testbed release detected to be: None 134s autopkgtest [04:10:22]: updating testbed package index (apt update) 135s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [110 kB] 135s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 135s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 135s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 135s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [3120 B] 135s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [79.1 kB] 135s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [788 kB] 136s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.6 kB] 136s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 Packages [97.6 kB] 136s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted arm64 Packages [7960 B] 136s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 Packages [698 kB] 136s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 Packages [12.1 kB] 136s Fetched 1811 kB in 1s (1729 kB/s) 137s Reading package lists... 138s + lsb_release --codename --short 138s + RELEASE=plucky 138s + cat 138s + [ plucky != trusty ] 138s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y --allow-downgrades -o Dpkg::Options::=--force-confnew dist-upgrade 138s Reading package lists... 138s Building dependency tree... 138s Reading state information... 140s Calculating upgrade... 141s The following packages will be upgraded: 141s dhcpcd-base 141s 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 141s Need to get 216 kB of archives. 141s After this operation, 0 B of additional disk space will be used. 141s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 dhcpcd-base arm64 1:10.1.0-7 [216 kB] 142s Fetched 216 kB in 0s (501 kB/s) 143s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 116620 files and directories currently installed.) 143s Preparing to unpack .../dhcpcd-base_1%3a10.1.0-7_arm64.deb ... 143s Unpacking dhcpcd-base (1:10.1.0-7) over (1:10.1.0-6) ... 143s Setting up dhcpcd-base (1:10.1.0-7) ... 143s Processing triggers for man-db (2.13.0-1) ... 144s + rm /etc/apt/preferences.d/force-downgrade-to-release.pref 144s + /usr/lib/apt/apt-helper analyze-pattern ?true 144s + uname -r 144s + sed s/\./\\./g 144s + running_kernel_pattern=^linux-.*6\.12\.0-15-generic.* 144s + + tail -n+2 144s apt list ?obsolete 144s + cut -d/ -f1 144s + grep -v ^linux-.*6\.12\.0-15-generic.* 145s + true 145s + obsolete_pkgs= 145s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y purge --autoremove 145s Reading package lists... 145s Building dependency tree... 145s Reading state information... 146s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 146s + grep -q trusty /etc/lsb-release 146s + [ ! -d /usr/share/doc/unattended-upgrades ] 146s + [ ! -d /usr/share/doc/lxd ] 146s + [ ! -d /usr/share/doc/lxd-client ] 146s + [ ! -d /usr/share/doc/snapd ] 146s + type iptables 146s + cat 146s + chmod 755 /etc/rc.local 146s + . /etc/rc.local 146s + iptables -w -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 146s + iptables -A OUTPUT -d 10.255.255.1/32 -p tcp -j DROP 146s + iptables -A OUTPUT -d 10.255.255.2/32 -p tcp -j DROP 146s + uname -m 146s + [ aarch64 = ppc64le ] 146s + [ -d /run/systemd/system ] 146s + systemd-detect-virt --quiet --vm 146s + mkdir -p /etc/systemd/system/systemd-random-seed.service.d/ 146s + cat 146s + grep -q lz4 /etc/initramfs-tools/initramfs.conf 146s + echo COMPRESS=lz4 146s autopkgtest [04:10:34]: upgrading testbed (apt dist-upgrade and autopurge) 146s Reading package lists... 147s Building dependency tree... 147s Reading state information... 148s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 148s Starting 2 pkgProblemResolver with broken count: 0 148s Done 150s Entering ResolveByKeep 150s 151s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 151s Reading package lists... 152s Building dependency tree... 152s Reading state information... 152s Starting pkgProblemResolver with broken count: 0 152s Starting 2 pkgProblemResolver with broken count: 0 152s Done 154s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 156s autopkgtest [04:10:44]: testbed running kernel: Linux 6.12.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 4 15:49:33 UTC 2025 157s autopkgtest [04:10:45]: @@@@@@@@@@@@@@@@@@@@ apt-source python-inline-snapshot 159s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (dsc) [3233 B] 159s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (tar) [87.9 kB] 159s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (diff) [7508 B] 159s gpgv: Signature made Thu Jan 16 17:58:09 2025 UTC 159s gpgv: using RSA key FC875C834BC71FB6546250A86E25BF686AA7D62A 159s gpgv: issuer "katharasasikumar007@gmail.com" 159s gpgv: Can't check signature: No public key 159s dpkg-source: warning: cannot verify inline signature for ./python-inline-snapshot_0.19.3-1.dsc: no acceptable signature found 159s autopkgtest [04:10:47]: testing package python-inline-snapshot version 0.19.3-1 160s autopkgtest [04:10:48]: build not needed 160s autopkgtest [04:10:48]: test upstream-tests: preparing testbed 160s Reading package lists... 161s Building dependency tree... 161s Reading state information... 161s Starting pkgProblemResolver with broken count: 0 161s Starting 2 pkgProblemResolver with broken count: 0 161s Done 162s The following NEW packages will be installed: 162s black python-inline-snapshot-doc python3-all python3-annotated-types 162s python3-asttokens python3-click python3-dateutil python3-dirty-equals 162s python3-dnspython python3-email-validator python3-executing 162s python3-freezegun python3-hypothesis python3-iniconfig 162s python3-inline-snapshot python3-mypy-extensions python3-packaging 162s python3-pathspec python3-platformdirs python3-pluggy python3-pydantic 162s python3-pydantic-core python3-pytest python3-pytest-freezer 162s python3-pytest-mock python3-pytest-subtests python3-sortedcontainers 162s python3-time-machine python3.12 python3.12-minimal 162s 0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded. 162s Need to get 8472 kB of archives. 162s After this operation, 43.6 MB of additional disk space will be used. 162s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 python3.12-minimal arm64 3.12.9-1 [2236 kB] 163s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 python3.12 arm64 3.12.9-1 [671 kB] 163s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 python3-click all 8.2.0-1 [81.9 kB] 163s Get:4 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-mypy-extensions all 1.0.0-1 [6148 B] 163s Get:5 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-packaging all 24.2-1 [51.5 kB] 163s Get:6 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pathspec all 0.12.1-1 [24.5 kB] 163s Get:7 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-platformdirs all 4.3.6-1 [16.8 kB] 163s Get:8 http://ftpmaster.internal/ubuntu plucky/universe arm64 black arm64 25.1.0-1 [1679 kB] 163s Get:9 http://ftpmaster.internal/ubuntu plucky/universe arm64 python-inline-snapshot-doc all 0.19.3-1 [541 kB] 163s Get:10 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-all arm64 3.13.1-1~exp2 [894 B] 163s Get:11 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-annotated-types all 0.7.0-1 [19.4 kB] 163s Get:12 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-asttokens all 3.0.0-1 [20.4 kB] 163s Get:13 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-dateutil all 2.9.0-3 [80.2 kB] 163s Get:14 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-dirty-equals all 0.9.0-1 [23.2 kB] 163s Get:15 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-dnspython all 2.7.0-1ubuntu1 [167 kB] 163s Get:16 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-email-validator all 2.2.0-1 [28.5 kB] 163s Get:17 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-executing all 2.2.0-0.1 [25.0 kB] 163s Get:18 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-freezegun all 1.5.1-1.2 [15.9 kB] 163s Get:19 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-sortedcontainers all 2.4.0-2 [27.6 kB] 163s Get:20 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-hypothesis all 6.125.2-1 [333 kB] 163s Get:21 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-iniconfig all 1.1.1-2 [6024 B] 163s Get:22 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-inline-snapshot all 0.19.3-1 [32.5 kB] 163s Get:23 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pluggy all 1.5.0-1 [21.0 kB] 163s Get:24 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pydantic-core arm64 2.27.2-1 [1773 kB] 163s Get:25 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pydantic arm64 2.10.6-1 [288 kB] 163s Get:26 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pytest all 8.3.4-1 [252 kB] 163s Get:27 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pytest-freezer all 0.4.9-1 [4542 B] 163s Get:28 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pytest-mock all 3.14.0-2 [11.7 kB] 163s Get:29 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pytest-subtests all 0.13.1-1 [10.8 kB] 163s Get:30 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-time-machine arm64 2.16.0-1 [24.8 kB] 164s Fetched 8472 kB in 1s (6607 kB/s) 164s Selecting previously unselected package python3.12-minimal. 164s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 116620 files and directories currently installed.) 164s Preparing to unpack .../00-python3.12-minimal_3.12.9-1_arm64.deb ... 164s Unpacking python3.12-minimal (3.12.9-1) ... 164s Selecting previously unselected package python3.12. 164s Preparing to unpack .../01-python3.12_3.12.9-1_arm64.deb ... 164s Unpacking python3.12 (3.12.9-1) ... 164s Selecting previously unselected package python3-click. 164s Preparing to unpack .../02-python3-click_8.2.0-1_all.deb ... 164s Unpacking python3-click (8.2.0-1) ... 164s Selecting previously unselected package python3-mypy-extensions. 164s Preparing to unpack .../03-python3-mypy-extensions_1.0.0-1_all.deb ... 164s Unpacking python3-mypy-extensions (1.0.0-1) ... 164s Selecting previously unselected package python3-packaging. 164s Preparing to unpack .../04-python3-packaging_24.2-1_all.deb ... 164s Unpacking python3-packaging (24.2-1) ... 164s Selecting previously unselected package python3-pathspec. 164s Preparing to unpack .../05-python3-pathspec_0.12.1-1_all.deb ... 164s Unpacking python3-pathspec (0.12.1-1) ... 164s Selecting previously unselected package python3-platformdirs. 164s Preparing to unpack .../06-python3-platformdirs_4.3.6-1_all.deb ... 164s Unpacking python3-platformdirs (4.3.6-1) ... 164s Selecting previously unselected package black. 164s Preparing to unpack .../07-black_25.1.0-1_arm64.deb ... 164s Unpacking black (25.1.0-1) ... 164s Selecting previously unselected package python-inline-snapshot-doc. 164s Preparing to unpack .../08-python-inline-snapshot-doc_0.19.3-1_all.deb ... 164s Unpacking python-inline-snapshot-doc (0.19.3-1) ... 165s Selecting previously unselected package python3-all. 165s Preparing to unpack .../09-python3-all_3.13.1-1~exp2_arm64.deb ... 165s Unpacking python3-all (3.13.1-1~exp2) ... 165s Selecting previously unselected package python3-annotated-types. 165s Preparing to unpack .../10-python3-annotated-types_0.7.0-1_all.deb ... 165s Unpacking python3-annotated-types (0.7.0-1) ... 165s Selecting previously unselected package python3-asttokens. 165s Preparing to unpack .../11-python3-asttokens_3.0.0-1_all.deb ... 165s Unpacking python3-asttokens (3.0.0-1) ... 165s Selecting previously unselected package python3-dateutil. 165s Preparing to unpack .../12-python3-dateutil_2.9.0-3_all.deb ... 165s Unpacking python3-dateutil (2.9.0-3) ... 165s Selecting previously unselected package python3-dirty-equals. 165s Preparing to unpack .../13-python3-dirty-equals_0.9.0-1_all.deb ... 165s Unpacking python3-dirty-equals (0.9.0-1) ... 165s Selecting previously unselected package python3-dnspython. 165s Preparing to unpack .../14-python3-dnspython_2.7.0-1ubuntu1_all.deb ... 165s Unpacking python3-dnspython (2.7.0-1ubuntu1) ... 165s Selecting previously unselected package python3-email-validator. 165s Preparing to unpack .../15-python3-email-validator_2.2.0-1_all.deb ... 165s Unpacking python3-email-validator (2.2.0-1) ... 165s Selecting previously unselected package python3-executing. 165s Preparing to unpack .../16-python3-executing_2.2.0-0.1_all.deb ... 165s Unpacking python3-executing (2.2.0-0.1) ... 165s Selecting previously unselected package python3-freezegun. 165s Preparing to unpack .../17-python3-freezegun_1.5.1-1.2_all.deb ... 165s Unpacking python3-freezegun (1.5.1-1.2) ... 165s Selecting previously unselected package python3-sortedcontainers. 165s Preparing to unpack .../18-python3-sortedcontainers_2.4.0-2_all.deb ... 165s Unpacking python3-sortedcontainers (2.4.0-2) ... 165s Selecting previously unselected package python3-hypothesis. 165s Preparing to unpack .../19-python3-hypothesis_6.125.2-1_all.deb ... 165s Unpacking python3-hypothesis (6.125.2-1) ... 165s Selecting previously unselected package python3-iniconfig. 165s Preparing to unpack .../20-python3-iniconfig_1.1.1-2_all.deb ... 165s Unpacking python3-iniconfig (1.1.1-2) ... 165s Selecting previously unselected package python3-inline-snapshot. 165s Preparing to unpack .../21-python3-inline-snapshot_0.19.3-1_all.deb ... 165s Unpacking python3-inline-snapshot (0.19.3-1) ... 165s Selecting previously unselected package python3-pluggy. 165s Preparing to unpack .../22-python3-pluggy_1.5.0-1_all.deb ... 165s Unpacking python3-pluggy (1.5.0-1) ... 165s Selecting previously unselected package python3-pydantic-core. 165s Preparing to unpack .../23-python3-pydantic-core_2.27.2-1_arm64.deb ... 165s Unpacking python3-pydantic-core (2.27.2-1) ... 165s Selecting previously unselected package python3-pydantic. 165s Preparing to unpack .../24-python3-pydantic_2.10.6-1_arm64.deb ... 165s Unpacking python3-pydantic (2.10.6-1) ... 166s Selecting previously unselected package python3-pytest. 166s Preparing to unpack .../25-python3-pytest_8.3.4-1_all.deb ... 166s Unpacking python3-pytest (8.3.4-1) ... 166s Selecting previously unselected package python3-pytest-freezer. 166s Preparing to unpack .../26-python3-pytest-freezer_0.4.9-1_all.deb ... 166s Unpacking python3-pytest-freezer (0.4.9-1) ... 166s Selecting previously unselected package python3-pytest-mock. 166s Preparing to unpack .../27-python3-pytest-mock_3.14.0-2_all.deb ... 166s Unpacking python3-pytest-mock (3.14.0-2) ... 166s Selecting previously unselected package python3-pytest-subtests. 166s Preparing to unpack .../28-python3-pytest-subtests_0.13.1-1_all.deb ... 166s Unpacking python3-pytest-subtests (0.13.1-1) ... 166s Selecting previously unselected package python3-time-machine. 166s Preparing to unpack .../29-python3-time-machine_2.16.0-1_arm64.deb ... 166s Unpacking python3-time-machine (2.16.0-1) ... 166s Setting up python3-iniconfig (1.1.1-2) ... 166s Setting up python3.12-minimal (3.12.9-1) ... 167s Setting up python3-pydantic-core (2.27.2-1) ... 167s Setting up python3-asttokens (3.0.0-1) ... 168s Setting up python3-mypy-extensions (1.0.0-1) ... 168s Setting up python3.12 (3.12.9-1) ... 169s Setting up python3-dirty-equals (0.9.0-1) ... 170s Setting up python3-all (3.13.1-1~exp2) ... 170s Setting up python3-sortedcontainers (2.4.0-2) ... 170s Setting up python3-click (8.2.0-1) ... 170s Setting up python3-annotated-types (0.7.0-1) ... 170s Setting up python3-platformdirs (4.3.6-1) ... 171s Setting up python3-packaging (24.2-1) ... 171s Setting up python3-executing (2.2.0-0.1) ... 171s Setting up python3-pluggy (1.5.0-1) ... 171s Setting up python3-dnspython (2.7.0-1ubuntu1) ... 172s Setting up python3-dateutil (2.9.0-3) ... 172s Setting up python3-email-validator (2.2.0-1) ... 173s Setting up python-inline-snapshot-doc (0.19.3-1) ... 173s Setting up python3-pathspec (0.12.1-1) ... 173s Setting up python3-freezegun (1.5.1-1.2) ... 173s Setting up python3-pytest (8.3.4-1) ... 174s Setting up python3-hypothesis (6.125.2-1) ... 175s Setting up black (25.1.0-1) ... 175s Setting up python3-time-machine (2.16.0-1) ... 175s Setting up python3-inline-snapshot (0.19.3-1) ... 176s Setting up python3-pydantic (2.10.6-1) ... 176s Setting up python3-pytest-freezer (0.4.9-1) ... 177s Setting up python3-pytest-mock (3.14.0-2) ... 177s Setting up python3-pytest-subtests (0.13.1-1) ... 177s Processing triggers for man-db (2.13.0-1) ... 178s Processing triggers for systemd (257.2-3ubuntu1) ... 179s autopkgtest [04:11:07]: test upstream-tests: [----------------------- 179s 179s *************************** 179s *** Testing with python3.12 179s *************************** 179s 179s Content of current working folder: 179s 179s total 12 179s drwxr-xr-x 3 ubuntu ubuntu 4096 Feb 19 04:11 . 179s drwxrwxrwt 5 root root 4096 Feb 19 04:11 .. 179s drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 15 18:43 tests 179s Running tests... 179s 181s ============================= test session starts ============================== 181s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 181s rootdir: /tmp/autopkgtest.2UZR8n/autopkgtest_tmp 181s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 181s collected 392 items / 10 deselected / 382 selected 181s 189s tests/adapter/test_dataclass.py FFFFEFE.FF.F.FEFEFEFF [ 4%] 189s tests/adapter/test_dict.py F [ 4%] 190s tests/adapter/test_general.py F. [ 4%] 190s tests/adapter/test_sequence.py FF..F [ 6%] 190s tests/test_align.py . [ 6%] 190s tests/test_change.py F [ 6%] 192s tests/test_code_repr.py FF.FFFF.............................F [ 16%] 197s tests/test_config.py FEFEFEFE [ 17%] 197s tests/test_dirty_equals.py xF..F [ 18%] 197s tests/test_docs.py .s [ 19%] 198s tests/test_example.py FE [ 19%] 210s tests/test_external.py F..FFFFFFF..FFFF [ 23%] 212s tests/test_formating.py FF.. [ 24%] 212s tests/test_fstring.py .. [ 25%] 212s tests/test_hasrepr.py . [ 25%] 214s tests/test_inline_snapshot.py ..uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.,,,,,,,,, [ 26%] 216s ,,,,,,,,,,,,,,,,,,,,,.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 39%] 219s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,,.,,.,,,.,,.,,., [ 55%] 219s ,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,, [ 61%] 219s .,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,. [ 67%] 219s ,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,, [ 73%] 220s ,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,. [ 79%] 220s ,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.FFFFFFF...FF.FFFF..F [ 86%] 220s tests/test_is.py F [ 87%] 220s tests/test_is_normalized.py F [ 87%] 222s tests/test_preserve_values.py FFFFFFFFFFuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 225s uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 228s uuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 229s uuuuuuuuuuuuuuu,. [ 90%] 235s tests/test_pydantic.py FEFEFE.FE [ 91%] 236s tests/test_pypy.py F [ 91%] 258s tests/test_pytest_plugin.py .FFFFF.FFFFF.F.FFF..FFFE [ 97%] 258s tests/test_raises.py . [ 98%] 258s tests/test_rewrite_code.py .F [ 98%] 260s tests/test_string.py FFF. [ 99%] 260s tests/test_warns.py . [100%] 260s 260s ==================================== ERRORS ==================================== 260s ________________ ERROR at teardown of test_attrs_default_value _________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s import attrs 260s 260s @attrs.define 260s class A: 260s a:int 260s b:int=2 260s c:list=attrs.field(factory=list) 260s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 260s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpgzvpr723 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 260s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 260s 260s test_something.py:13: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpgzvpr723/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 260s ============================== 1 failed in 0.28s =============================== 260s 260s stderr: 260s 260s __________________ ERROR at teardown of test_attrs_field_repr __________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s import attrs 260s 260s @attrs.define 260s class container: 260s a: int 260s b: int = attrs.field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmptsf0lrh0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ______________________ ERROR collecting test_something.py ______________________ 260s test_something.py:9: in 260s assert container(a=1,b=5) == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.35s =============================== 260s 260s stderr: 260s 260s _____________ ERROR at teardown of test_remove_positional_argument _____________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 260s 260s 260s class L: 260s def __init__(self,*l): 260s self.l=l 260s 260s def __eq__(self,other): 260s if not isinstance(other,L): 260s return NotImplemented 260s return other.l==self.l 260s 260s class LAdapter(GenericCallAdapter): 260s @classmethod 260s def check_type(cls, typ): 260s return issubclass(typ,L) 260s 260s @classmethod 260s def arguments(cls, value): 260s return ([Argument(x) for x in value.l],{}) 260s 260s @classmethod 260s def argument(cls, value, pos_or_name): 260s assert isinstance(pos_or_name,int) 260s return value.l[pos_or_name] 260s 260s def test_L1(): 260s assert L(1,2) == snapshot(L(1)), "not equal" 260s 260s def test_L2(): 260s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpa77lpdz5 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 2 items 260s 260s test_something.py F. [100%] 260s 260s =================================== FAILURES =================================== 260s ___________________________________ test_L1 ____________________________________ 260s 260s def test_L1(): 260s > assert L(1,2) == snapshot(L(1)), "not equal" 260s 260s test_something.py:30: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 260s new_code=self.context.file._value_to_code(value.value), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpa77lpdz5/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s ──────────────────────────────── Fix snapshots ───────────────────────────────── 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 260s diff = file.diff() 260s ^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 260s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 260s ^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s ^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _____________________ ERROR at teardown of test_namedtuple _____________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from collections import namedtuple 260s 260s T=namedtuple("T","a,b") 260s 260s def test_tuple(): 260s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpveits3ev 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s __________________________________ test_tuple __________________________________ 260s 260s def test_tuple(): 260s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 260s 260s test_something.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpveits3ev/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 260s ============================== 1 failed in 0.26s =============================== 260s 260s stderr: 260s 260s ____________________ ERROR at teardown of test_defaultdict _____________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from collections import defaultdict 260s 260s 260s def test_tuple(): 260s d=defaultdict(list) 260s d[1].append(2) 260s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpgrjqwqrg 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s __________________________________ test_tuple __________________________________ 260s 260s def test_tuple(): 260s d=defaultdict(list) 260s d[1].append(2) 260s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 260s 260s test_something.py:8: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 260s result = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpgrjqwqrg/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 260s ============================== 1 failed in 0.28s =============================== 260s 260s stderr: 260s 260s __________________ ERROR at teardown of test_config_pyproject __________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s file: pyproject.toml 260s 260s [tool.inline-snapshot] 260s default-flags = ["trim"] 260s 260s 260s run> /usr/bin/python3.12 -m pytest 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpk09sxbs3 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpk09sxbs3/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _____________________ ERROR at teardown of test_config_env _____________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s run> /usr/bin/python3.12 -m pytest 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpl6sundj5 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpl6sundj5/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _____________________ ERROR at teardown of test_shortcuts ______________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s file: pyproject.toml 260s 260s [tool.inline-snapshot.shortcuts] 260s strim=["trim"] 260s 260s 260s run> /usr/bin/python3.12 -m pytest --strim 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpxkj95oj0 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpxkj95oj0/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _________________ ERROR at teardown of test_default_shortcuts __________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s file: pyproject.toml 260s 260s 260s 260s run> /usr/bin/python3.12 -m pytest --fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpoeq6yveh 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpoeq6yveh/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s ______________________ ERROR at teardown of test_example _______________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s 260s 260s file: test_b.py 260s 1+1 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpy31se7kv 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 1==snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpy31se7kv/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s ============================== 1 failed in 0.24s =============================== 260s 260s stderr: 260s 260s file: test_b.py 260s 1+1 260s 260s file: test_a.py 260s 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s 260s 260s run> pytest /tmp/tmp41aquc6w/test_b.py 260s run> pytest /tmp/tmp41aquc6w/test_a.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp41aquc6w/test_a.py", line 5, in test_a 260s assert 1==snapshot(2) 260s ^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ______________ ERROR at teardown of test_pydantic_create_snapshot ______________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s 260s from pydantic import BaseModel 260s from inline_snapshot import snapshot 260s 260s class M(BaseModel): 260s size:int 260s name:str 260s age:int=4 260s 260s def test_pydantic(): 260s m=M(size=5,name="Tom") 260s assert m==snapshot() 260s assert m.dict()==snapshot() 260s 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpd9kcd1vs 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_pydantic _________________________________ 260s 260s def test_pydantic(): 260s m=M(size=5,name="Tom") 260s > assert m==snapshot() 260s 260s test_something.py:12: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '', filename = PosixPath('/tmp/tmpd9kcd1vs/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 260s ============================== 1 failed in 0.30s =============================== 260s 260s stderr: 260s 260s ________________ ERROR at teardown of test_pydantic_field_repr _________________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel,Field 260s 260s class container(BaseModel): 260s a: int 260s b: int = Field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp9eop5s50 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ______________________ ERROR collecting test_something.py ______________________ 260s test_something.py:8: in 260s assert container(a=1,b=5) == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.37s =============================== 260s 260s stderr: 260s 260s _______________ ERROR at teardown of test_pydantic_default_value _______________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s from pydantic import BaseModel,Field 260s 260s class A(BaseModel): 260s a:int 260s b:int=2 260s c:list=Field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpcgdnbr0b 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py . [100%] 260s =============================== inline snapshot ================================ 260s ─────────────────────────────── Update snapshots ─────────────────────────────── 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 260s diff = file.diff() 260s ^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 260s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 260s ^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s ^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s ______________ ERROR at teardown of test_pydantic_factory_method _______________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel 260s 260s class A(BaseModel): 260s a:int 260s 260s @classmethod 260s def from_str(cls,s): 260s return cls(a=int(s)) 260s 260s def test_something(): 260s for a in [1,2]: 260s assert A(a=2) == snapshot(A.from_str("1")) 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp2oz4m04b 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s for a in [1,2]: 260s > assert A(a=2) == snapshot(A.from_str("1")) 260s 260s test_something.py:13: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 260s result = yield from self.value_assign(old_value, old_node, new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 260s result = yield from adapter.assign(old_value, old_node, new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'A (a =2 )', filename = PosixPath('/tmp/tmp2oz4m04b/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 260s ============================== 1 failed in 0.30s =============================== 260s 260s stderr: 260s 260s ________ ERROR at teardown of test_find_pyproject_in_parent_directories ________ 260s some snapshots in this test have incorrect values. 260s ----------------------------- Captured stdout call ----------------------------- 260s file: pyproject.toml 260s [tool.inline-snapshot] 260s hash-length=2 260s 260s 260s file: project/pytest.ini 260s 260s 260s file: project/test_something.py 260s from inline_snapshot import outsource,snapshot,external 260s 260s def test_something(): 260s assert outsource("test") == snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpiz6b7v9e/project 260s configfile: ../pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s project/test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s > assert outsource("test") == snapshot() 260s 260s project/test_something.py:4: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '', filename = PosixPath('/tmp/tmpiz6b7v9e/project/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 260s ============================== 1 failed in 0.25s =============================== 260s 260s stderr: 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_unmanaged ________________________________ 260s 260s def test_unmanaged(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s b:int 260s 260s def test_something(): 260s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s b:int 260s 260s def test_something(): 260s assert A(a=2,b=4) == snapshot(A(a=2,b=Is(1))), "not equal" 260s """ 260s } 260s ), 260s raises=snapshot( 260s """\ 260s AssertionError: 260s not equal\ 260s """ 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:21: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/adapter/test_dataclass.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s b:int 260s 260s def test_something(): 260s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 260s 260s 260s run> pytest /tmp/tmpiffusrhx/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpiffusrhx/test_something.py", line 10, in test_something 260s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _________________________________ test_reeval __________________________________ 260s 260s def test_reeval(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s b:int 260s 260s def test_something(): 260s for c in "ab": 260s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s b:int 260s 260s def test_something(): 260s for c in "ab": 260s assert A(a=1,b=c) == snapshot(A(a=1,b=Is(c))) 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:63: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s b:int 260s 260s def test_something(): 260s for c in "ab": 260s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 260s 260s 260s run> pytest /tmp/tmpam5ndvc_/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpam5ndvc_/test_something.py", line 11, in test_something 260s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _________________________ test_dataclass_default_value _________________________ 260s 260s def test_dataclass_default_value(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class A: 260s a:int 260s b:int=2 260s c:list=field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=update"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class A: 260s a:int 260s b:int=2 260s c:list=field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1)) 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:100: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:214: in run_inline 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'from inline_snapshot import snapshot,Is\nfrom dataclasses import dataclass,field\n\n@dataclass\nclass A:\n a:int\n...t=2\n c:list=field(default_factory=list)\n\ndef test_something():\n assert A(a=1) == snapshot(A(a=1,b=2,c=[]))\n' 260s filename = PosixPath('/tmp/tmpuda1f6a4/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class A: 260s a:int 260s b:int=2 260s c:list=field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 260s 260s 260s run> pytest /tmp/tmpuda1f6a4/test_something.py 260s ___________________________ test_attrs_default_value ___________________________ 260s 260s def test_attrs_default_value(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s import attrs 260s 260s @attrs.define 260s class A: 260s a:int 260s b:int=2 260s c:list=attrs.field(factory=list) 260s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 260s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s import attrs 260s 260s @attrs.define 260s class A: 260s a:int 260s b:int=2 260s c:list=attrs.field(factory=list) 260s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 260s assert A(a=2,b=3) == snapshot(A(a=2,b=3,c=[],d=11)) 260s """ 260s } 260s ), 260s ).run_pytest( 260s ["--inline-snapshot=update"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s import attrs 260s 260s @attrs.define 260s class A: 260s a:int 260s b:int=2 260s c:list=attrs.field(factory=list) 260s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1)) 260s assert A(a=2,b=3) == snapshot(A(a=2,b=3)) 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:139: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_someth...=[],d=11))\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 260s E 'import attrs\n' 260s E '\n' 260s E '@attrs.define\n' 260s E 'class A:\n'... 260s E 260s E ...Full output truncated (11 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s import attrs 260s 260s @attrs.define 260s class A: 260s a:int 260s b:int=2 260s c:list=attrs.field(factory=list) 260s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 260s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpgzvpr723 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 260s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 260s 260s test_something.py:13: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpgzvpr723/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 260s ============================== 1 failed in 0.28s =============================== 260s 260s stderr: 260s 260s ____________________________ test_attrs_field_repr _____________________________ 260s 260s def test_attrs_field_repr(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s import attrs 260s 260s @attrs.define 260s class container: 260s a: int 260s b: int = attrs.field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s import attrs 260s 260s @attrs.define 260s class container: 260s a: int 260s b: int = attrs.field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot(container(a=1)) 260s """ 260s } 260s ), 260s ).run_pytest() 260s 260s tests/adapter/test_dataclass.py:198: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot\n' 260s E 'import attrs\n' 260s E '\n' 260s E '@attrs.define\n' 260s E 'class container:\n'... 260s E 260s E ...Full output truncated (5 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s import attrs 260s 260s @attrs.define 260s class container: 260s a: int 260s b: int = attrs.field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmptsf0lrh0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ______________________ ERROR collecting test_something.py ______________________ 260s test_something.py:9: in 260s assert container(a=1,b=5) == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.35s =============================== 260s 260s stderr: 260s 260s ___________________________ test_disabled[executing] ___________________________ 260s 260s executing_used = True 260s 260s def test_disabled(executing_used): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s 260s def test_something(): 260s assert A(a=3) == snapshot(A(a=5)),"not equal" 260s """ 260s > ).run_inline( 260s changed_files=snapshot({}), 260s raises=snapshot( 260s """\ 260s AssertionError: 260s not equal\ 260s """ 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:261: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/adapter/test_dataclass.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s 260s def test_something(): 260s assert A(a=3) == snapshot(A(a=5)),"not equal" 260s 260s 260s run> pytest /tmp/tmpbhjow387/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpbhjow387/test_something.py", line 9, in test_something 260s assert A(a=3) == snapshot(A(a=5)),"not equal" 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _______________________ test_disabled[without-executing] _______________________ 260s 260s executing_used = False 260s 260s def test_disabled(executing_used): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s 260s def test_something(): 260s assert A(a=3) == snapshot(A(a=5)),"not equal" 260s """ 260s > ).run_inline( 260s changed_files=snapshot({}), 260s raises=snapshot( 260s """\ 260s AssertionError: 260s not equal\ 260s """ 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:261: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:53: in assign 260s and self.context.file._token_of_node(old_node) != new_token 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s node = 260s 260s def _token_of_node(self, node): 260s 260s return list( 260s normalize( 260s [ 260s simple_token(t.type, t.string) 260s > for t in self._source.asttokens().get_tokens(node) 260s if t.type not in ignore_tokens 260s ] 260s ) 260s ) 260s E AttributeError: 'NoneType' object has no attribute 'asttokens' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:45: AttributeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int 260s 260s def test_something(): 260s assert A(a=3) == snapshot(A(a=5)),"not equal" 260s 260s 260s run> pytest /tmp/tmpltghh_mv/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpltghh_mv/test_something.py", line 9, in test_something 260s assert A(a=3) == snapshot(A(a=5)),"not equal" 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError: not equal 260s ______________________________ test_add_argument _______________________________ 260s 260s def test_add_argument(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int=0 260s b:int=0 260s c:int=0 260s 260s def test_something(): 260s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int=0 260s b:int=0 260s c:int=0 260s 260s def test_something(): 260s assert A(a=3,b=3,c=3) == snapshot(A(a = 3, b=3, c = 3)),"not equal" 260s """ 260s } 260s ), 260s raises=snapshot(None), 260s ) 260s 260s tests/adapter/test_dataclass.py:322: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/adapter/test_dataclass.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass 260s 260s @dataclass 260s class A: 260s a:int=0 260s b:int=0 260s c:int=0 260s 260s def test_something(): 260s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 260s 260s 260s run> pytest /tmp/tmp_pw4klfs/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp_pw4klfs/test_something.py", line 11, in test_something 260s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 207, in assign 260s new_code=self.context.file._value_to_code(value), 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 37, in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _______________________ test_remove_positional_argument ________________________ 260s 260s def test_remove_positional_argument(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s 260s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 260s 260s 260s class L: 260s def __init__(self,*l): 260s self.l=l 260s 260s def __eq__(self,other): 260s if not isinstance(other,L): 260s return NotImplemented 260s return other.l==self.l 260s 260s class LAdapter(GenericCallAdapter): 260s @classmethod 260s def check_type(cls, typ): 260s return issubclass(typ,L) 260s 260s @classmethod 260s def arguments(cls, value): 260s return ([Argument(x) for x in value.l],{}) 260s 260s @classmethod 260s def argument(cls, value, pos_or_name): 260s assert isinstance(pos_or_name,int) 260s return value.l[pos_or_name] 260s 260s def test_L1(): 260s assert L(1,2) == snapshot(L(1)), "not equal" 260s 260s def test_L2(): 260s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s 260s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 260s 260s 260s class L: 260s def __init__(self,*l): 260s self.l=l 260s 260s def __eq__(self,other): 260s if not isinstance(other,L): 260s return NotImplemented 260s return other.l==self.l 260s 260s class LAdapter(GenericCallAdapter): 260s @classmethod 260s def check_type(cls, typ): 260s return issubclass(typ,L) 260s 260s @classmethod 260s def arguments(cls, value): 260s return ([Argument(x) for x in value.l],{}) 260s 260s @classmethod 260s def argument(cls, value, pos_or_name): 260s assert isinstance(pos_or_name,int) 260s return value.l[pos_or_name] 260s 260s def test_L1(): 260s assert L(1,2) == snapshot(L(1, 2)), "not equal" 260s 260s def test_L2(): 260s assert L(1,2) == snapshot(L(1, 2)), "not equal" 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:408: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E assert {'test_someth...not equal"\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot\n' 260s E '\n' 260s E 'from inline_snapshot._adapter.generic_call_adapter ' 260s E 'import GenericCallAdapter,Argument\n' 260s E '\n'... 260s E 260s E ...Full output truncated (30 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 260s 260s 260s class L: 260s def __init__(self,*l): 260s self.l=l 260s 260s def __eq__(self,other): 260s if not isinstance(other,L): 260s return NotImplemented 260s return other.l==self.l 260s 260s class LAdapter(GenericCallAdapter): 260s @classmethod 260s def check_type(cls, typ): 260s return issubclass(typ,L) 260s 260s @classmethod 260s def arguments(cls, value): 260s return ([Argument(x) for x in value.l],{}) 260s 260s @classmethod 260s def argument(cls, value, pos_or_name): 260s assert isinstance(pos_or_name,int) 260s return value.l[pos_or_name] 260s 260s def test_L1(): 260s assert L(1,2) == snapshot(L(1)), "not equal" 260s 260s def test_L2(): 260s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpa77lpdz5 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 2 items 260s 260s test_something.py F. [100%] 260s 260s =================================== FAILURES =================================== 260s ___________________________________ test_L1 ____________________________________ 260s 260s def test_L1(): 260s > assert L(1,2) == snapshot(L(1)), "not equal" 260s 260s test_something.py:30: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 260s new_code=self.context.file._value_to_code(value.value), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpa77lpdz5/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s ──────────────────────────────── Fix snapshots ───────────────────────────────── 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 260s diff = file.diff() 260s ^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 260s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 260s ^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s ^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _______________________________ test_namedtuple ________________________________ 260s 260s def test_namedtuple(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from collections import namedtuple 260s 260s T=namedtuple("T","a,b") 260s 260s def test_tuple(): 260s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from collections import namedtuple 260s 260s T=namedtuple("T","a,b") 260s 260s def test_tuple(): 260s assert T(a=1,b=2) == snapshot(T(a=1, b=2)), "not equal" 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:463: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E assert {'test_someth...not equal"\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot\n' 260s E 'from collections import namedtuple\n' 260s E '\n' 260s E 'T=namedtuple("T","a,b")\n' 260s E '\n'... 260s E 260s E ...Full output truncated (4 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from collections import namedtuple 260s 260s T=namedtuple("T","a,b") 260s 260s def test_tuple(): 260s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpveits3ev 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s __________________________________ test_tuple __________________________________ 260s 260s def test_tuple(): 260s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 260s 260s test_something.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 260s result_kwargs[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpveits3ev/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 260s ============================== 1 failed in 0.26s =============================== 260s 260s stderr: 260s 260s _______________________________ test_defaultdict _______________________________ 260s 260s def test_defaultdict(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from collections import defaultdict 260s 260s 260s def test_tuple(): 260s d=defaultdict(list) 260s d[1].append(2) 260s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from collections import defaultdict 260s 260s 260s def test_tuple(): 260s d=defaultdict(list) 260s d[1].append(2) 260s assert d == snapshot(defaultdict(list, {1: [2]})), "not equal" 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:493: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E assert {'test_someth...not equal"\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot\n' 260s E 'from collections import defaultdict\n' 260s E '\n' 260s E '\n' 260s E 'def test_tuple():\n'... 260s E 260s E ...Full output truncated (5 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from collections import defaultdict 260s 260s 260s def test_tuple(): 260s d=defaultdict(list) 260s d[1].append(2) 260s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpgrjqwqrg 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s __________________________________ test_tuple __________________________________ 260s 260s def test_tuple(): 260s d=defaultdict(list) 260s d[1].append(2) 260s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 260s 260s test_something.py:8: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 260s result = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmpgrjqwqrg/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 260s ============================== 1 failed in 0.28s =============================== 260s 260s stderr: 260s 260s __________________________ test_dataclass_field_repr ___________________________ 260s 260s def test_dataclass_field_repr(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class container: 260s a: int 260s b: int = field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class container: 260s a: int 260s b: int = field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot(container(a=1)) 260s """ 260s } 260s ), 260s ).run_inline() 260s 260s tests/adapter/test_dataclass.py:526: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class container: 260s a: int 260s b: int = field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s 260s 260s run> pytest /tmp/tmpygmku4_w/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 260s exec( 260s File "/tmp/tmpygmku4_w/test_something.py", line 9, in 260s assert container(a=1,b=5) == snapshot() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ______________________________ test_dataclass_var ______________________________ 260s 260s def test_dataclass_var(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class container: 260s a: int 260s 260s def test_list(): 260s l=container(5) 260s assert l == snapshot(l), "not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=update"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class container: 260s a: int 260s 260s def test_list(): 260s l=container(5) 260s assert l == snapshot(container(a=5)), "not equal" 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dataclass.py:561: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=update'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s 260s @dataclass 260s class container: 260s a: int 260s 260s def test_list(): 260s l=container(5) 260s assert l == snapshot(l), "not equal" 260s 260s 260s run> pytest /tmp/tmpmeybfoaw/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpmeybfoaw/test_something.py", line 10, in test_list 260s assert l == snapshot(l), "not equal" 260s ^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 101, in assign 260s result = yield from self.value_assign(old_value, old_node, new_value) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 260s result = yield from adapter.assign(old_value, old_node, new_value) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ________________________________ test_dict_var _________________________________ 260s 260s def test_dict_var(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s 260s def test_list(): 260s l={1:2} 260s assert l == snapshot(l), "not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=update"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s 260s def test_list(): 260s l={1:2} 260s assert l == snapshot({1: 2}), "not equal" 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_dict.py:15: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=update'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s 260s def test_list(): 260s l={1:2} 260s assert l == snapshot(l), "not equal" 260s 260s 260s run> pytest /tmp/tmp4zi21ecm/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp4zi21ecm/test_something.py", line 5, in test_list 260s assert l == snapshot(l), "not equal" 260s ^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py", line 62, in assign 260s result = yield from self.value_assign(old_value, old_node, new_value) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 260s result = yield from adapter.assign(old_value, old_node, new_value) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ____________________________ test_adapter_mismatch _____________________________ 260s 260s def test_adapter_mismatch(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s 260s 260s def test_thing(): 260s assert [1,2] == snapshot({1:2}) 260s 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s 260s 260s def test_thing(): 260s assert [1,2] == snapshot([1, 2]) 260s 260s \ 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_general.py:16: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s 260s def test_thing(): 260s assert [1,2] == snapshot({1:2}) 260s 260s 260s 260s run> pytest /tmp/tmpq0w9yuko/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpq0w9yuko/test_something.py", line 5, in test_thing 260s assert [1,2] == snapshot({1:2}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ___________________ test_list_adapter_create_inner_snapshot ____________________ 260s 260s def test_list_adapter_create_inner_snapshot(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from dirty_equals import IsInt 260s 260s def test_list(): 260s 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from dirty_equals import IsInt 260s 260s def test_list(): 260s 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 260s """ 260s } 260s ), 260s raises=snapshot(None), 260s ) 260s 260s tests/adapter/test_sequence.py:17: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/adapter/test_sequence.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from dirty_equals import IsInt 260s 260s def test_list(): 260s 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 260s 260s 260s run> pytest /tmp/tmp0fwy9ddy/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp0fwy9ddy/test_something.py", line 6, in test_list 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 260s return _return(self._visible_value() == other) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 260s return self.value == other 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _____________________ test_list_adapter_fix_inner_snapshot _____________________ 260s 260s def test_list_adapter_fix_inner_snapshot(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from dirty_equals import IsInt 260s 260s def test_list(): 260s 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from dirty_equals import IsInt 260s 260s def test_list(): 260s 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 260s """ 260s } 260s ), 260s raises=snapshot(None), 260s ) 260s 260s tests/adapter/test_sequence.py:46: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/adapter/test_sequence.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from dirty_equals import IsInt 260s 260s def test_list(): 260s 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 260s 260s 260s run> pytest /tmp/tmpjs6pykzv/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpjs6pykzv/test_something.py", line 6, in test_list 260s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 260s return _return(self._visible_value() == other) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 260s return self.value == other 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ________________________________ test_list_var _________________________________ 260s 260s def test_list_var(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s 260s def test_list(): 260s l=[1] 260s assert l == snapshot(l), "not equal" 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=update"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s 260s def test_list(): 260s l=[1] 260s assert l == snapshot([1]), "not equal" 260s """ 260s } 260s ), 260s ) 260s 260s tests/adapter/test_sequence.py:92: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=update'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s 260s def test_list(): 260s l=[1] 260s assert l == snapshot(l), "not equal" 260s 260s 260s run> pytest /tmp/tmpjwkjuuz2/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpjwkjuuz2/test_something.py", line 5, in test_list 260s assert l == snapshot(l), "not equal" 260s ^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 52, in assign 260s result = yield from self.value_assign(old_value, old_node, new_value) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 260s result = yield from adapter.assign(old_value, old_node, new_value) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s __________________________ test_change_function_args ___________________________ 260s 260s check_change = .w at 0xeb30178819e0> 260s 260s def test_change_function_args(check_change): 260s 260s > check_change( 260s "f(a,b=2)", 260s lambda source, call: [ 260s Replace( 260s flag="fix", 260s file=source, 260s node=call.args[0], 260s new_code="22", 260s old_value=0, 260s new_value=0, 260s ) 260s ], 260s snapshot("f(22,b=2)"), 260s ) 260s 260s tests/test_change.py:48: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/test_change.py:37: in w 260s cr.virtual_write() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:244: in virtual_write 260s file.virtual_write() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:141: in virtual_write 260s self.source = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'f(a,b=2)' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_change_function_args0/test_0.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s test: f(a,b=2) 260s __________________________________ test_enum ___________________________________ 260s 260s check_update = .w at 0xeb30178813a0> 260s 260s def test_enum(check_update): 260s 260s assert ( 260s > check_update( 260s """ 260s from enum import Enum 260s 260s class color(Enum): 260s val="val" 260s 260s 260s assert [color.val] == snapshot() 260s 260s """, 260s flags="create", 260s ) 260s == snapshot( 260s """\ 260s 260s from enum import Enum 260s 260s class color(Enum): 260s val="val" 260s 260s 260s assert [color.val] == snapshot([color.val]) 260s 260s """ 260s ) 260s ) 260s 260s tests/test_code_repr.py:15: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py:16: in 260s assert [color.val] == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s | 260s |from enum import Enum 260s | 260s |class color(Enum): 260s | val="val" 260s | 260s | 260s |assert [color.val] == snapshot() 260s | 260s _______________________ test_snapshot_generates_hasrepr ________________________ 260s 260s def test_snapshot_generates_hasrepr(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s 260s class Thing: 260s def __repr__(self): 260s return "" 260s 260s def __eq__(self,other): 260s if not isinstance(other,Thing): 260s return NotImplemented 260s return True 260s 260s def test_thing(): 260s assert Thing() == snapshot() 260s 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=create"], 260s returncode=snapshot(0), 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s 260s from inline_snapshot import HasRepr 260s 260s class Thing: 260s def __repr__(self): 260s return "" 260s 260s def __eq__(self,other): 260s if not isinstance(other,Thing): 260s return NotImplemented 260s return True 260s 260s def test_thing(): 260s assert Thing() == snapshot(HasRepr(Thing, "")) 260s 260s \ 260s """ 260s } 260s ), 260s ).run_pytest( 260s ["--inline-snapshot=disable"], returncode=0 260s ).run_pytest( 260s returncode=0 260s ) 260s 260s tests/test_code_repr.py:63: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: in run_pytest 260s assert result.returncode == returncode 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_code_repr.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s class Thing: 260s def __repr__(self): 260s return "" 260s 260s def __eq__(self,other): 260s if not isinstance(other,Thing): 260s return NotImplemented 260s return True 260s 260s def test_thing(): 260s assert Thing() == snapshot() 260s 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp2osmjcjg 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s __________________________________ test_thing __________________________________ 260s 260s def test_thing(): 260s > assert Thing() == snapshot() 260s 260s test_something.py:13: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '', filename = PosixPath('/tmp/tmp2osmjcjg/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_thing - TypeError: CliRunner.__init__() got an... 260s ============================== 1 failed in 0.26s =============================== 260s 260s stderr: 260s 260s ____________________________ test_enum_in_dataclass ____________________________ 260s 260s check_update = .w at 0xeb30178816c0> 260s 260s def test_enum_in_dataclass(check_update): 260s 260s assert ( 260s > check_update( 260s """ 260s from enum import Enum 260s from dataclasses import dataclass 260s 260s class color(Enum): 260s red="red" 260s blue="blue" 260s 260s @dataclass 260s class container: 260s bg: color=color.red 260s fg: color=color.blue 260s 260s assert container(bg=color.red,fg=color.red) == snapshot() 260s 260s """, 260s flags="create", 260s ) 260s == snapshot( 260s """\ 260s 260s from enum import Enum 260s from dataclasses import dataclass 260s 260s class color(Enum): 260s red="red" 260s blue="blue" 260s 260s @dataclass 260s class container: 260s bg: color=color.red 260s fg: color=color.blue 260s 260s assert container(bg=color.red,fg=color.red) == snapshot(container(fg=color.red)) 260s 260s """ 260s ) 260s ) 260s 260s tests/test_code_repr.py:106: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py:22: in 260s assert container(bg=color.red,fg=color.red) == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s | 260s |from enum import Enum 260s |from dataclasses import dataclass 260s | 260s |class color(Enum): 260s | red="red" 260s | blue="blue" 260s | 260s |@dataclass 260s |class container: 260s | bg: color=color.red 260s | fg: color=color.blue 260s | 260s |assert container(bg=color.red,fg=color.red) == snapshot() 260s | 260s __________________________________ test_flag ___________________________________ 260s 260s check_update = .w at 0xeb3017881c60> 260s 260s def test_flag(check_update): 260s 260s assert ( 260s > check_update( 260s """ 260s from enum import Flag, auto 260s 260s class Color(Flag): 260s red = auto() 260s green = auto() 260s blue = auto() 260s 260s assert Color.red | Color.blue == snapshot() 260s 260s """, 260s flags="create", 260s ) 260s == snapshot( 260s """\ 260s 260s from enum import Flag, auto 260s 260s class Color(Flag): 260s red = auto() 260s green = auto() 260s blue = auto() 260s 260s assert Color.red | Color.blue == snapshot(Color.red | Color.blue) 260s 260s """ 260s ) 260s ) 260s 260s tests/test_code_repr.py:150: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py:17: in 260s assert Color.red | Color.blue == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s | 260s |from enum import Flag, auto 260s | 260s |class Color(Flag): 260s | red = auto() 260s | green = auto() 260s | blue = auto() 260s | 260s |assert Color.red | Color.blue == snapshot() 260s | 260s __________________________________ test_type ___________________________________ 260s 260s check_update = .w at 0xeb30178825c0> 260s 260s def test_type(check_update): 260s 260s assert ( 260s > check_update( 260s """\ 260s class Color: 260s pass 260s 260s assert [Color,int] == snapshot() 260s 260s """, 260s flags="create", 260s ) 260s == snapshot( 260s """\ 260s class Color: 260s pass 260s 260s assert [Color,int] == snapshot([Color, int]) 260s 260s """ 260s ) 260s ) 260s 260s tests/test_code_repr.py:184: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py:12: in 260s assert [Color,int] == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |class Color: 260s | pass 260s | 260s |assert [Color,int] == snapshot() 260s | 260s ________________________________ test_qualname _________________________________ 260s 260s def test_qualname(): 260s 260s Example( 260s """\ 260s from enum import Enum 260s from inline_snapshot import snapshot 260s 260s 260s class Namespace: 260s class Color(Enum): 260s red="red" 260s 260s assert Namespace.Color.red == snapshot() 260s 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from enum import Enum 260s from inline_snapshot import snapshot 260s 260s 260s class Namespace: 260s class Color(Enum): 260s red="red" 260s 260s assert Namespace.Color.red == snapshot(Namespace.Color.red) 260s 260s \ 260s """ 260s } 260s ), 260s ).run_inline() 260s 260s tests/test_code_repr.py:221: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from enum import Enum 260s from inline_snapshot import snapshot 260s 260s 260s class Namespace: 260s class Color(Enum): 260s red="red" 260s 260s assert Namespace.Color.red == snapshot() 260s 260s 260s 260s run> pytest /tmp/tmpga_erb1m/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 260s exec( 260s File "/tmp/tmpga_erb1m/test_something.py", line 9, in 260s assert Namespace.Color.red == snapshot() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ______________________________ test_invalid_repr _______________________________ 260s 260s check_update = .w at 0xeb301767b240> 260s 260s def test_invalid_repr(check_update): 260s assert ( 260s > check_update( 260s """\ 260s class Thing: 260s def __repr__(self): 260s return "+++" 260s 260s def __eq__(self,other): 260s if not isinstance(other,Thing): 260s return NotImplemented 260s return True 260s 260s assert Thing() == snapshot() 260s """, 260s flags="create", 260s ) 260s == snapshot( 260s """\ 260s class Thing: 260s def __repr__(self): 260s return "+++" 260s 260s def __eq__(self,other): 260s if not isinstance(other,Thing): 260s return NotImplemented 260s return True 260s 260s assert Thing() == snapshot(HasRepr(Thing, "+++")) 260s """ 260s ) 260s ) 260s 260s tests/test_code_repr.py:351: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py:18: in 260s assert Thing() == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |class Thing: 260s | def __repr__(self): 260s | return "+++" 260s | 260s | def __eq__(self,other): 260s | if not isinstance(other,Thing): 260s | return NotImplemented 260s | return True 260s | 260s |assert Thing() == snapshot() 260s ____________________________ test_config_pyproject _____________________________ 260s 260s def test_config_pyproject(): 260s 260s Example( 260s { 260s **file_to_trim, 260s "pyproject.toml": """ 260s [tool.inline-snapshot] 260s default-flags = ["trim"] 260s """, 260s } 260s > ).run_pytest(changed_files=trimmed_files) 260s 260s tests/test_config.py:37: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = [] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_a.py': 'from inline_snapshot import snapshot\n' 260s E '\n' 260s E 'def test_a():\n' 260s E ' assert 1 <= snapshot(1)\n' 260s E ' assert 1 == snapshot(2)\n'} 260s E Use -v to get more diff 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s file: pyproject.toml 260s 260s [tool.inline-snapshot] 260s default-flags = ["trim"] 260s 260s 260s run> /usr/bin/python3.12 -m pytest 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpk09sxbs3 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpk09sxbs3/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _______________________________ test_config_env ________________________________ 260s 260s def test_config_env(): 260s > Example(file_to_trim).run_pytest( 260s env={"INLINE_SNAPSHOT_DEFAULT_FLAGS": "trim"}, changed_files=trimmed_files 260s ) 260s 260s tests/test_config.py:41: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = [] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_a.py': 'from inline_snapshot import snapshot\n' 260s E '\n' 260s E 'def test_a():\n' 260s E ' assert 1 <= snapshot(1)\n' 260s E ' assert 1 == snapshot(2)\n'} 260s E Use -v to get more diff 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s run> /usr/bin/python3.12 -m pytest 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpl6sundj5 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpl6sundj5/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s ________________________________ test_shortcuts ________________________________ 260s 260s def test_shortcuts(): 260s 260s Example( 260s { 260s **file_to_trim, 260s "pyproject.toml": """ 260s [tool.inline-snapshot.shortcuts] 260s strim=["trim"] 260s """, 260s } 260s > ).run_pytest(["--strim"], changed_files=trimmed_files) 260s 260s tests/test_config.py:56: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--strim'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_a.py': 'from inline_snapshot import snapshot\n' 260s E '\n' 260s E 'def test_a():\n' 260s E ' assert 1 <= snapshot(1)\n' 260s E ' assert 1 == snapshot(2)\n'} 260s E Use -v to get more diff 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s file: pyproject.toml 260s 260s [tool.inline-snapshot.shortcuts] 260s strim=["trim"] 260s 260s 260s run> /usr/bin/python3.12 -m pytest --strim 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpxkj95oj0 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpxkj95oj0/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s ____________________________ test_default_shortcuts ____________________________ 260s 260s def test_default_shortcuts(): 260s 260s Example( 260s { 260s **file_to_trim, 260s "pyproject.toml": """ 260s """, 260s } 260s > ).run_pytest( 260s ["--fix"], 260s changed_files=snapshot( 260s { 260s "test_a.py": """\ 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(1) 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_config.py:67: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--fix'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_a.py':...napshot(1)\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_a.py': 'from inline_snapshot import snapshot\n' 260s E '\n' 260s E 'def test_a():\n' 260s E ' assert 1 <= snapshot(5)\n' 260s E ' assert 1 == snapshot(1)\n'} 260s E Use -v to get more diff 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s assert 1 == snapshot(2) 260s 260s 260s file: pyproject.toml 260s 260s 260s 260s run> /usr/bin/python3.12 -m pytest --fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpoeq6yveh 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert 1 <= snapshot(5) 260s > assert 1 == snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpoeq6yveh/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _______________________ test_compare_dirty_equals_twice ________________________ 260s 260s def test_compare_dirty_equals_twice() -> None: 260s 260s Example( 260s """ 260s from dirty_equals import IsStr 260s from inline_snapshot import snapshot 260s 260s for x in 'ab': 260s assert x == snapshot(IsStr()) 260s assert [x,5] == snapshot([IsStr(),3]) 260s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 260s 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s 260s from dirty_equals import IsStr 260s from inline_snapshot import snapshot 260s 260s for x in 'ab': 260s assert x == snapshot(IsStr()) 260s assert [x,5] == snapshot([IsStr(),5]) 260s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':5}) 260s 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_dirty_equals.py:47: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s 260s from dirty_equals import IsStr 260s from inline_snapshot import snapshot 260s 260s for x in 'ab': 260s assert x == snapshot(IsStr()) 260s assert [x,5] == snapshot([IsStr(),3]) 260s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 260s 260s 260s 260s run> pytest /tmp/tmpye8kcnpc/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 260s exec( 260s File "/tmp/tmpye8kcnpc/test_something.py", line 7, in 260s assert [x,5] == snapshot([IsStr(),3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 260s v = yield from self.get_adapter( 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _____________________ test_dirty_equals_with_changing_args _____________________ 260s 260s def test_dirty_equals_with_changing_args() -> None: 260s 260s Example( 260s """\ 260s from dirty_equals import IsInt 260s from inline_snapshot import snapshot 260s 260s def test_number(): 260s 260s for i in range(5): 260s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 260s 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from dirty_equals import IsInt 260s from inline_snapshot import snapshot 260s 260s def test_number(): 260s 260s for i in range(5): 260s assert ["a",i] == snapshot(["a",IsInt(gt=i-1,lt=i+1)]) 260s 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_dirty_equals.py:138: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from dirty_equals import IsInt 260s from inline_snapshot import snapshot 260s 260s def test_number(): 260s 260s for i in range(5): 260s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 260s 260s 260s 260s run> pytest /tmp/tmpn118mjzq/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpn118mjzq/test_something.py", line 7, in test_number 260s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 260s v = yield from self.get_adapter( 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _________________________________ test_example _________________________________ 260s 260s def test_example(): 260s 260s e = Example( 260s { 260s "test_a.py": """ 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s """, 260s "test_b.py": "1+1", 260s }, 260s ) 260s 260s e.run_pytest( 260s ["--inline-snapshot=create,fix"], 260s ) 260s 260s > e.run_inline( 260s ["--inline-snapshot=fix"], 260s reported_categories=snapshot(["fix"]), 260s ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot({}), 260s ) 260s 260s tests/test_example.py:23: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s > assert sorted(snapshot_flags) == reported_categories 260s E AssertionError: assert [] == ['fix'] 260s E 260s E Right contains one more item: 'fix' 260s E Use -v to get more diff 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:223: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s 260s 260s file: test_b.py 260s 1+1 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpy31se7kv 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_a.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 1==snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmpy31se7kv/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s ============================== 1 failed in 0.24s =============================== 260s 260s stderr: 260s 260s file: test_b.py 260s 1+1 260s 260s file: test_a.py 260s 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s 260s 260s run> pytest /tmp/tmp41aquc6w/test_b.py 260s run> pytest /tmp/tmp41aquc6w/test_a.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp41aquc6w/test_a.py", line 5, in test_a 260s assert 1==snapshot(2) 260s ^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s __________________________________ test_basic __________________________________ 260s 260s check_update = .w at 0xeb3017678680> 260s 260s def test_basic(check_update): 260s > assert check_update( 260s "assert outsource('text') == snapshot()", flags="create" 260s ) == snapshot( 260s "assert outsource('text') == snapshot(external(\"982d9e3eb996*.txt\"))" 260s ) 260s 260s tests/test_external.py:12: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py:9: in 260s assert outsource('text') == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert outsource('text') == snapshot() 260s _________________________________ test_persist _________________________________ 260s 260s project = .Project object at 0xeb3017571700> 260s 260s def test_persist(project): 260s 260s project.setup( 260s """\ 260s from inline_snapshot import external 260s 260s def test_something(): 260s assert "hello" == snapshot(external("bbbbb*.txt")) 260s assert 2 == snapshot(1+1) 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=update") 260s 260s assert project.storage() == snapshot([]) 260s 260s > assert project.source == snapshot( 260s """\ 260s from inline_snapshot import external 260s 260s def test_something(): 260s assert "hello" == snapshot(external("bbbbb*.txt")) 260s assert 2 == snapshot(2) 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:78: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_something():\n assert "hello" == snapshot(external("bbbbb*.txt"))\n assert 2 == snapshot(1+1)\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s from inline_snapshot import external 260s 260s def test_something(): 260s assert "hello" == snapshot(external("bbbbb*.txt")) 260s assert 2 == snapshot(1+1) 260s 260s running: pytest --inline-snapshot=update 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s > assert "hello" == snapshot(external("bbbbb*.txt")) 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'hello'" 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 260s ============================== 1 failed in 0.36s =============================== 260s _________________________ test_pytest_compare_external _________________________ 260s 260s project = .Project object at 0xeb30175734a0> 260s 260s def test_pytest_compare_external(project): 260s project.setup( 260s """\ 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource("test") == snapshot( 260s external("9f86d081884c*.txt") 260s ) 260s 260s assert outsource("test2") == snapshot( 260s external("9f86d081884c*.txt") 260s ) 260s """ 260s ) 260s 260s result = project.run() 260s 260s > assert result.errorLines() == snapshot( 260s """\ 260s > assert outsource("test2") == snapshot( 260s E AssertionError: assert 'test2' == 'test' 260s E ⏎ 260s E - test 260s E + test2 260s E ? + 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:123: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\n> assert outsource("test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource("test") == snapshot( 260s external("9f86d081884c*.txt") 260s ) 260s 260s assert outsource("test2") == snapshot( 260s external("9f86d081884c*.txt") 260s ) 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert outsource("test") == snapshot( 260s external("9f86d081884c*.txt") 260s ) 260s 260s > assert outsource("test2") == snapshot( 260s external("9f86d081884c*.txt") 260s ) 260s 260s test_file.py:11: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'external ("60303ae22b99*.txt")' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.34s =============================== 260s ______________________ test_pytest_compare_external_bytes ______________________ 260s 260s project = .Project object at 0xeb3017282e70> 260s 260s def test_pytest_compare_external_bytes(project): 260s project.setup( 260s """\ 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource(b"test") == snapshot( 260s external("9f86d081884c*.bin") 260s ) 260s 260s assert outsource(b"test2") == snapshot( 260s external("9f86d081884c*.bin") 260s ) 260s """ 260s ) 260s 260s result = project.run() 260s 260s > assert result.errorLines() == snapshot( 260s """\ 260s > assert outsource(b"test2") == snapshot( 260s E AssertionError: assert b'test2' == b'test' 260s E ⏎ 260s E Use -v to get more diff 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:153: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\n> assert outsource(b"test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource(b"test") == snapshot( 260s external("9f86d081884c*.bin") 260s ) 260s 260s assert outsource(b"test2") == snapshot( 260s external("9f86d081884c*.bin") 260s ) 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s assert outsource(b"test") == snapshot( 260s external("9f86d081884c*.bin") 260s ) 260s 260s > assert outsource(b"test2") == snapshot( 260s external("9f86d081884c*.bin") 260s ) 260s 260s test_file.py:11: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'external ("60303ae22b99*.bin")' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.33s =============================== 260s _____________________ test_pytest_existing_external_import _____________________ 260s 260s project = .Project object at 0xeb3017283920> 260s 260s def test_pytest_existing_external_import(project): 260s project.setup( 260s """\ 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource("test") == snapshot() 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=create") 260s 260s > assert project.source == snapshot( 260s """\ 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:175: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s from inline_snapshot import external 260s 260s def test_a(): 260s assert outsource("test") == snapshot() 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.29s =============================== 260s __________________________ test_pytest_trim_external ___________________________ 260s 260s project = .Project object at 0xeb3017283fe0> 260s 260s def test_pytest_trim_external(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert outsource("test") == snapshot() 260s 260s # split 260s 260s assert outsource("test2") == snapshot() 260s """ 260s ) 260s 260s project.run("--inline-snapshot=create") 260s 260s > assert project.storage() == snapshot( 260s [ 260s "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.txt", 260s "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt", 260s ] 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:199: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert outsource("test") == snapshot() 260s 260s # split 260s 260s assert outsource("test2") == snapshot() 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.31s =============================== 260s ___________________________ test_pytest_new_external ___________________________ 260s 260s project = .Project object at 0xeb30172abaa0> 260s 260s def test_pytest_new_external(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert outsource("test") == snapshot() 260s """ 260s ) 260s project.run() 260s 260s assert project.storage() == snapshot( 260s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt"] 260s ) 260s 260s project.run("--inline-snapshot=create") 260s 260s > assert project.storage() == snapshot( 260s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt"] 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:255: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert outsource("test") == snapshot() 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py FE [100%] 260s 260s ==================================== ERRORS ==================================== 260s _________________________ ERROR at teardown of test_a __________________________ 260s your snapshot is missing one value. 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 260s ========================== 1 failed, 1 error in 0.32s ========================== 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.30s =============================== 260s ________________________ test_pytest_config_hash_length ________________________ 260s 260s project = .Project object at 0xeb30172abbc0> 260s 260s def test_pytest_config_hash_length(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert outsource("test") == snapshot() 260s """ 260s ) 260s project.run("--inline-snapshot=create") 260s default_result = project.source 260s 260s # default config 260s project.pyproject( 260s """ 260s [tool.inline-snapshot] 260s """ 260s ) 260s project.run("--inline-snapshot=create") 260s assert default_result == project.source 260s 260s # set hash_length 260s project.pyproject( 260s """ 260s [tool.inline-snapshot] 260s hash-length=5 260s """ 260s ) 260s project.run("--inline-snapshot=create") 260s > assert project.source == snapshot( 260s """\ 260s from inline_snapshot import external 260s 260s 260s def test_a(): 260s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:287: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert outsource("test") == snapshot() 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.30s =============================== 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.29s =============================== 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert outsource("test") == snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.30s =============================== 260s _______________________________ test_no_imports ________________________________ 260s 260s project = .Project object at 0xeb301731f6b0> 260s 260s def test_no_imports(project): 260s project.setup( 260s """\ 260s # no imports 260s 260s def test_something(): 260s from inline_snapshot import outsource,snapshot 260s assert outsource("test") == snapshot() 260s test_something() 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=create") 260s 260s > result.assert_outcomes(passed=1) 260s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 260s E 260s E Omitting 4 identical items, use -vv to show 260s E Differing items: 260s E {'errors': 1} != {'errors': 0} 260s E {'passed': 0} != {'passed': 1} 260s E Use -v to get more diff 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:340: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s 260s 260s # no imports 260s 260s def test_something(): 260s from inline_snapshot import outsource,snapshot 260s assert outsource("test") == snapshot() 260s test_something() 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ________________________ ERROR collecting test_file.py _________________________ 260s test_file.py:9: in 260s test_something() 260s test_file.py:8: in test_something 260s assert outsource("test") == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.28s =============================== 260s _____________________________ test_ensure_imports ______________________________ 260s 260s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0') 260s 260s def test_ensure_imports(tmp_path): 260s file = tmp_path / "file.py" 260s file.write_text( 260s """\ 260s from os import environ 260s from os import getcwd 260s """, 260s "utf-8", 260s ) 260s 260s > with apply_changes(): 260s 260s tests/test_external.py:372: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3.12/contextlib.py:144: in __exit__ 260s next(self.gen) 260s tests/utils.py:32: in apply_changes 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'from os import environ\nfrom os import getcwd\n' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0/file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s _______________________ test_ensure_imports_with_comment _______________________ 260s 260s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0') 260s 260s def test_ensure_imports_with_comment(tmp_path): 260s file = tmp_path / "file.py" 260s file.write_text( 260s """\ 260s from os import environ # comment 260s """, 260s "utf-8", 260s ) 260s 260s > with apply_changes(): 260s 260s tests/test_external.py:394: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3.12/contextlib.py:144: in __exit__ 260s next(self.gen) 260s tests/utils.py:32: in apply_changes 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'from os import environ # comment\n' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0/file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ______________________________ test_new_externals ______________________________ 260s 260s project = .Project object at 0xeb301731fa40> 260s 260s def test_new_externals(project): 260s project.setup( 260s """ 260s 260s def test_something(): 260s outsource("blub") 260s 260s assert outsource("foo") == snapshot() 260s 260s """ 260s ) 260s 260s project.run("--inline-snapshot=create") 260s 260s > assert project.storage() == snapshot( 260s [ 260s "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae.txt", 260s "8dc140e6fe831481a2005ae152ffe32a9974aa92a260dfbac780d6a87154bb0b-new.txt", 260s ] 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py:420: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae-new.txt'" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_external.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s 260s 260s def test_something(): 260s outsource("blub") 260s 260s assert outsource("foo") == snapshot() 260s 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s outsource("blub") 260s 260s > assert outsource("foo") == snapshot() 260s 260s test_file.py:11: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_new_externals0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 260s ============================== 1 failed in 0.30s =============================== 260s _________________________ test_black_formatting_error __________________________ 260s 260s mocker = 260s 260s def test_black_formatting_error(mocker): 260s mocker.patch.object(CliRunner, "invoke", return_value=SimpleNamespace(exit_code=1)) 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s 260s def test_something(): 260s assert 1==snapshot() 260s assert 1==snapshot(2) 260s assert list(range(20)) == snapshot() 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=fix,create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s 260s def test_something(): 260s assert 1==snapshot(1) 260s assert 1==snapshot(1) 260s assert list(range(20)) == snapshot([0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19 ]) 260s """ 260s } 260s ), 260s report=snapshot( 260s """\ 260s ----------------------------------- Problems ----------------------------------- 260s black could not format your code, which might be caused by this issue: 260s https://github.com/15r10nk/inline-snapshot/issues/138 260s 260s """ 260s ), 260s ) 260s 260s tests/test_formating.py:24: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix,create'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s def test_something(): 260s assert 1==snapshot() 260s assert 1==snapshot(2) 260s assert list(range(20)) == snapshot() 260s 260s 260s run> pytest /tmp/tmp8rm6d9lc/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp8rm6d9lc/test_something.py", line 4, in test_something 260s assert 1==snapshot() 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _______________________________ test_fstring_139 _______________________________ 260s 260s def test_fstring_139(): 260s Example( 260s """ 260s from inline_snapshot import snapshot 260s snapshot(f'') 260s snapshot(rf'') 260s snapshot(Rf'') 260s snapshot(F'') 260s snapshot(rF'') 260s snapshot(RF'') 260s 260s 260s def test_a(): 260s return None 260s """ 260s > ).run_pytest(returncode=0) 260s 260s tests/test_formating.py:64: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = [] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s > assert result.returncode == returncode 260s E AssertionError: assert 1 == 0 260s E + where 1 = CompletedProcess(args=['/usr/bin/python3.12', '-m', 'pytest'], returncode=1, stdout=b'============================= te... ^^^^^^^^^^^^^^^^^^^^^^^^^^^\nTypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n').returncode 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s 260s from inline_snapshot import snapshot 260s snapshot(f'') 260s snapshot(rf'') 260s snapshot(Rf'') 260s snapshot(F'') 260s snapshot(rF'') 260s snapshot(RF'') 260s 260s 260s def test_a(): 260s return None 260s 260s 260s run> /usr/bin/python3.12 -m pytest 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpx2wfqm3l 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py . [100%] 260s =============================== inline snapshot ================================ 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 260s for change in snapshot._changes(): 260s ^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 260s yield from self._value._get_changes() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 218, in _get_changes 260s yield from handle(self._ast_node, self._old_value) 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 206, in handle 260s new_code = self._file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _______________ test_generic[executing] [assert 4 == snapshot()] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py:9: in 260s assert 4 == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 == snapshot() 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________ test_generic[executing] [assert 4 == snapshot({})[0]] _____________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py:9: in 260s assert 4 == snapshot({})[0] 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 == snapshot({})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic[executing] [assert 4 == snapshot(5)] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py:9: in 260s assert 4 == snapshot(5) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 == snapshot(5) 260s ------------------------------ Captured log call ------------------------------- 260s 260s __________ test_generic[executing] [assert 4 == snapshot({0: 5})[0]] ___________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py:9: in 260s assert 4 == snapshot({0: 5})[0] 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 == snapshot({0: 5})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic[executing] [assert 4 == snapshot(2+2)] ______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py:9: in 260s assert 4 == snapshot(2+2) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 == snapshot(2+2) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] __________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py:9: in 260s assert 4 == snapshot({0: 2+2})[0] 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 == snapshot({0: 2+2})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic[executing] [assert 4 <= snapshot()] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 260s new_code = self._value._new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_7.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 <= snapshot() 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________ test_generic[executing] [assert 4 <= snapshot({})[0]] _____________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_8.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 <= snapshot({})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic[executing] [assert 4 <= snapshot(5)] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_9.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 <= snapshot(5) 260s ------------------------------ Captured log call ------------------------------- 260s 260s __________ test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] ___________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_10.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 <= snapshot({0: 5})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic[executing] [assert 5 <= snapshot(4)] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 <= snapshot(4) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py", line 9, in 260s assert 5 <= snapshot(4) 260s ^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s __________ test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] ___________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 <= snapshot({0: 4})[0] 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py", line 9, in 260s assert 5 <= snapshot({0: 4})[0] 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic[executing] [assert 5 <= snapshot(3+2)] ______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_13.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 <= snapshot(3+2) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] __________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_14.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 <= snapshot({0: 3+2})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic[executing] [assert 5 >= snapshot()] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 260s new_code = self._value._new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_15.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 >= snapshot() 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________ test_generic[executing] [assert 5 >= snapshot({})[0]] _____________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_16.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 >= snapshot({})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic[executing] [assert 5 >= snapshot(4)] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_17.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 >= snapshot(4) 260s ------------------------------ Captured log call ------------------------------- 260s 260s __________ test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] ___________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_18.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 >= snapshot({0: 4})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic[executing] [assert 4 >= snapshot(5)] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 >= snapshot(5) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py", line 9, in 260s assert 4 >= snapshot(5) 260s ^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s __________ test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] ___________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 4 >= snapshot({0: 5})[0] 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py", line 9, in 260s assert 4 >= snapshot({0: 5})[0] 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic[executing] [assert 5 >= snapshot(3+2)] ______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_21.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 >= snapshot(3+2) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] __________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_22.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 >= snapshot({0: 3+2})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic[executing] [assert 5 in snapshot()] _______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 260s new_code = self._value._new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '[5 ]' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_23.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot() 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________ test_generic[executing] [assert 5 in snapshot({})[0]] _____________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '[5 ]' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_24.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________ test_generic[executing] [assert 5 in snapshot([4, 5])] ____________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s s = source(code) 260s print("source:", code) 260s 260s if not executing_used and reported_flag == "update": 260s assert not s.flags 260s else: 260s assert list(s.flags) == [reported_flag] 260s 260s assert (reported_flag == "fix") == s.error 260s 260s for flag in all_flags: 260s if flag == reported_flag: 260s continue 260s print("use flag:", flag) 260s s2 = s.run(flag) 260s assert s2.source == s.source 260s 260s if not executing_used: 260s continue 260s 260s > s2 = s.run(reported_flag) 260s 260s tests/test_inline_snapshot.py:99: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert 5 in snapshot([4, 5])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_29.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([4, 5]) 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert 5 in snapshot([4, 5]) 260s source: assert 5 in snapshot([4, 5]) 260s use flag: fix 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([4, 5]) 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot=fix 260s output: 260s |assert 5 in snapshot([4, 5]) 260s use flag: create 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([4, 5]) 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot=create 260s output: 260s |assert 5 in snapshot([4, 5]) 260s use flag: update 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([4, 5]) 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot=update 260s output: 260s |assert 5 in snapshot([4, 5]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([4, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ________ test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] ________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s s = source(code) 260s print("source:", code) 260s 260s if not executing_used and reported_flag == "update": 260s assert not s.flags 260s else: 260s assert list(s.flags) == [reported_flag] 260s 260s assert (reported_flag == "fix") == s.error 260s 260s for flag in all_flags: 260s if flag == reported_flag: 260s continue 260s print("use flag:", flag) 260s s2 = s.run(flag) 260s assert s2.source == s.source 260s 260s if not executing_used: 260s continue 260s 260s > s2 = s.run(reported_flag) 260s 260s tests/test_inline_snapshot.py:99: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert 5 in snapshot({0: [4, 5]})[0]' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_34.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s source: assert 5 in snapshot({0: [4, 5]})[0] 260s use flag: fix 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot=fix 260s output: 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s use flag: create 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot=create 260s output: 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s use flag: update 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s reported_flags: {'trim'} 260s run: pytest --inline-snapshot=update 260s output: 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: [4, 5]})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic[executing] [assert 5 in snapshot([])] ______________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py", line 9, in 260s assert 5 in snapshot([]) 260s ^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s __________ test_generic[executing] [assert 5 in snapshot({0: []})[0]] __________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: []})[0] 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py", line 9, in 260s assert 5 in snapshot({0: []})[0] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________ test_generic[executing] [assert 5 in snapshot([3+2])] _____________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_37.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot([3+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ________ test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] _________ 260s 260s source = .w at 0xeb301736b7e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s executing_used = True 260s 260s def test_generic(source, subtests, executing_used): 260s codes = [] 260s 260s for op in operations: 260s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 260s if op.svalue: 260s codes.append( 260s ( 260s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 260s op.flag, 260s ) 260s ) 260s else: 260s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 260s 260s all_flags = ["trim", "fix", "create", "update"] 260s 260s for code, reported_flag in codes: 260s with subtests.test(code): 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:79: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_38.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot({0: [3+2]})[0] 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic_multi[executing-create(==) fix(==)] _______________ 260s 260s source = .w at 0xeb301717aa20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 5}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(4 == s["k_1"]) # fix 5 -> 4 260s _____________ test_generic_multi[executing-create(==) update(==)] ______________ 260s 260s source = .w at 0xeb301717a2a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 2+2}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(4 == s["k_1"]) # update 2+2 -> 4 260s _____________ test_generic_multi[executing-create(==) create(<=)] ______________ 260s 260s source = .w at 0xeb301717ba60> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(4 <= s["k_1"]) # create -> 4 260s ______________ test_generic_multi[executing-create(==) trim(<=)] _______________ 260s 260s source = .w at 0xeb3016d284a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 5}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(4 <= s["k_1"]) # trim 5 -> 4 260s _______________ test_generic_multi[executing-create(==) fix(<=)] _______________ 260s 260s source = .w at 0xeb301717b9c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 4}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 <= s["k_1"]) # fix 4 -> 5 260s _____________ test_generic_multi[executing-create(==) update(<=)] ______________ 260s 260s source = .w at 0xeb301717b560> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 3+2}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 <= s["k_1"]) # update 3+2 -> 5 260s _____________ test_generic_multi[executing-create(==) create(>=)] ______________ 260s 260s source = .w at 0xeb3016d294e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 >= s["k_1"]) # create -> 5 260s ______________ test_generic_multi[executing-create(==) trim(>=)] _______________ 260s 260s source = .w at 0xeb301717be20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 4}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s _______________ test_generic_multi[executing-create(==) fix(>=)] _______________ 260s 260s source = .w at 0xeb3016d28cc0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 5}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s _____________ test_generic_multi[executing-create(==) update(>=)] ______________ 260s 260s source = .w at 0xeb3016d2a480> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 3+2}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s _____________ test_generic_multi[executing-create(==) create(in)] ______________ 260s 260s source = .w at 0xeb301736ad40> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # create -> [5] 260s ______________ test_generic_multi[executing-create(==) trim(in)] _______________ 260s 260s source = .w at 0xeb301717af20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [4, 5]}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s _______________ test_generic_multi[executing-create(==) fix(in)] _______________ 260s 260s source = .w at 0xeb301717bd80> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": []}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s _____________ test_generic_multi[executing-create(==) update(in)] ______________ 260s 260s source = .w at 0xeb301717aa20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py:10: in 260s print(4 == s["k_0"]) # create -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [3+2]}) 260s |print(4 == s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s _______________ test_generic_multi[executing-fix(==) update(==)] _______________ 260s 260s source = .w at 0xeb301736b740> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 2+2}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(4 == s["k_1"]) # update 2+2 -> 4 260s _______________ test_generic_multi[executing-fix(==) create(<=)] _______________ 260s 260s source = .w at 0xeb3016d282c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(4 <= s["k_1"]) # create -> 4 260s ________________ test_generic_multi[executing-fix(==) trim(<=)] ________________ 260s 260s source = .w at 0xeb301736b060> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 5}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(4 <= s["k_1"]) # trim 5 -> 4 260s ________________ test_generic_multi[executing-fix(==) fix(<=)] _________________ 260s 260s source = .w at 0xeb3016d29bc0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 4}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 <= s["k_1"]) # fix 4 -> 5 260s _______________ test_generic_multi[executing-fix(==) update(<=)] _______________ 260s 260s source = .w at 0xeb3016d2b1a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 3+2}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 <= s["k_1"]) # update 3+2 -> 5 260s _______________ test_generic_multi[executing-fix(==) create(>=)] _______________ 260s 260s source = .w at 0xeb3017179120> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 >= s["k_1"]) # create -> 5 260s ________________ test_generic_multi[executing-fix(==) trim(>=)] ________________ 260s 260s source = .w at 0xeb3016d28040> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 4}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s ________________ test_generic_multi[executing-fix(==) fix(>=)] _________________ 260s 260s source = .w at 0xeb3016e542c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 5}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s _______________ test_generic_multi[executing-fix(==) update(>=)] _______________ 260s 260s source = .w at 0xeb301717af20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 3+2}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s _______________ test_generic_multi[executing-fix(==) create(in)] _______________ 260s 260s source = .w at 0xeb3016d29440> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # create -> [5] 260s ________________ test_generic_multi[executing-fix(==) trim(in)] ________________ 260s 260s source = .w at 0xeb3016e55300> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s ________________ test_generic_multi[executing-fix(==) fix(in)] _________________ 260s 260s source = .w at 0xeb301717a340> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": []}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s _______________ test_generic_multi[executing-fix(==) update(in)] _______________ 260s 260s source = .w at 0xeb3016e54900> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py:10: in 260s print(4 == s["k_0"]) # fix 5 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 260s |print(4 == s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s _____________ test_generic_multi[executing-update(==) create(<=)] ______________ 260s 260s source = .w at 0xeb3016e563e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(4 <= s["k_1"]) # create -> 4 260s ______________ test_generic_multi[executing-update(==) trim(<=)] _______________ 260s 260s source = .w at 0xeb3016d2bba0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": 5}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(4 <= s["k_1"]) # trim 5 -> 4 260s _______________ test_generic_multi[executing-update(==) fix(<=)] _______________ 260s 260s source = .w at 0xeb3016e54900> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": 4}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 <= s["k_1"]) # fix 4 -> 5 260s _____________ test_generic_multi[executing-update(==) update(<=)] ______________ 260s 260s source = .w at 0xeb3016e574c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 <= s["k_1"]) # update 3+2 -> 5 260s _____________ test_generic_multi[executing-update(==) create(>=)] ______________ 260s 260s source = .w at 0xeb3016d2bb00> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 >= s["k_1"]) # create -> 5 260s ______________ test_generic_multi[executing-update(==) trim(>=)] _______________ 260s 260s source = .w at 0xeb3016e56fc0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": 4}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s _______________ test_generic_multi[executing-update(==) fix(>=)] _______________ 260s 260s source = .w at 0xeb3016ad85e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": 5}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s _____________ test_generic_multi[executing-update(==) update(>=)] ______________ 260s 260s source = .w at 0xeb3016d29e40> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s _____________ test_generic_multi[executing-update(==) create(in)] ______________ 260s 260s source = .w at 0xeb3016e55d00> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 in s["k_1"]) # create -> [5] 260s ______________ test_generic_multi[executing-update(==) trim(in)] _______________ 260s 260s source = .w at 0xeb3016ad9620> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": [4, 5]}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s _______________ test_generic_multi[executing-update(==) fix(in)] _______________ 260s 260s source = .w at 0xeb3016e55ee0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": []}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s _____________ test_generic_multi[executing-update(==) update(in)] ______________ 260s 260s source = .w at 0xeb3016ad8f40> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py:10: in 260s print(4 == s["k_0"]) # update 2+2 -> 4 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 2+2, "k_1": [3+2]}) 260s |print(4 == s["k_0"]) # update 2+2 -> 4 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s ______________ test_generic_multi[executing-create(<=) trim(<=)] _______________ 260s 260s source = .w at 0xeb3016ada480> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c14/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 5}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(4 <= s["k_1"]) # trim 5 -> 4 260s True 260s True 260s _______________ test_generic_multi[executing-create(<=) fix(<=)] _______________ 260s 260s source = .w at 0xeb3016e56ca0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c15/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 4}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 <= s["k_1"]) # fix 4 -> 5 260s True 260s False 260s _____________ test_generic_multi[executing-create(<=) update(<=)] ______________ 260s 260s source = .w at 0xeb3016ad8cc0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c16/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 3+2}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 <= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s _____________ test_generic_multi[executing-create(<=) create(>=)] ______________ 260s 260s source = .w at 0xeb3016adb240> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c17/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 >= s["k_1"]) # create -> 5 260s True 260s True 260s ______________ test_generic_multi[executing-create(<=) trim(>=)] _______________ 260s 260s source = .w at 0xeb3016e57ba0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c18/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 4}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s True 260s True 260s _______________ test_generic_multi[executing-create(<=) fix(>=)] _______________ 260s 260s source = .w at 0xeb3016e57560> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c19/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 5}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s True 260s False 260s _____________ test_generic_multi[executing-create(<=) update(>=)] ______________ 260s 260s source = .w at 0xeb3016e56b60> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c20/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 3+2}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s _____________ test_generic_multi[executing-create(<=) create(in)] ______________ 260s 260s source = .w at 0xeb3016e558a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c21/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # create -> [5] 260s True 260s True 260s ______________ test_generic_multi[executing-create(<=) trim(in)] _______________ 260s 260s source = .w at 0xeb3016e563e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c22/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [4, 5]}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-create(<=) fix(in)] _______________ 260s 260s source = .w at 0xeb3016e56660> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c23/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": []}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s _____________ test_generic_multi[executing-create(<=) update(in)] ______________ 260s 260s source = .w at 0xeb3016d2b240> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c24/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [3+2]}) 260s |print(4 <= s["k_0"]) # create -> 4 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s ________________ test_generic_multi[executing-trim(<=) fix(<=)] ________________ 260s 260s source = .w at 0xeb301717b880> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 4}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 <= s["k_1"]) # fix 4 -> 5 260s True 260s False 260s ______________ test_generic_multi[executing-trim(<=) update(<=)] _______________ 260s 260s source = .w at 0xeb3016e55440> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t1/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 3+2}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 <= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s ______________ test_generic_multi[executing-trim(<=) create(>=)] _______________ 260s 260s source = .w at 0xeb3016d2ac00> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t2/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 >= s["k_1"]) # create -> 5 260s True 260s True 260s _______________ test_generic_multi[executing-trim(<=) trim(>=)] ________________ 260s 260s source = .w at 0xeb3016d29760> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t3/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 4}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s True 260s True 260s ________________ test_generic_multi[executing-trim(<=) fix(>=)] ________________ 260s 260s source = .w at 0xeb3016e57a60> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t4/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 5}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s True 260s False 260s ______________ test_generic_multi[executing-trim(<=) update(>=)] _______________ 260s 260s source = .w at 0xeb3016ada660> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t5/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 3+2}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s ______________ test_generic_multi[executing-trim(<=) create(in)] _______________ 260s 260s source = .w at 0xeb3016d2ad40> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t6/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 in s["k_1"]) # create -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-trim(<=) trim(in)] ________________ 260s 260s source = .w at 0xeb3016ada2a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t7/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s ________________ test_generic_multi[executing-trim(<=) fix(in)] ________________ 260s 260s source = .w at 0xeb3016ad8a40> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t8/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": []}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s ______________ test_generic_multi[executing-trim(<=) update(in)] _______________ 260s 260s source = .w at 0xeb3016d29760> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t9/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 260s |print(4 <= s["k_0"]) # trim 5 -> 4 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-fix(<=) update(<=)] _______________ 260s 260s source = .w at 0xeb3016e57a60> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f13/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": 3+2}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 <= s["k_1"]) # update 3+2 -> 5 260s False 260s True 260s _______________ test_generic_multi[executing-fix(<=) create(>=)] _______________ 260s 260s source = .w at 0xeb30176f4680> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f14/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 >= s["k_1"]) # create -> 5 260s False 260s True 260s ________________ test_generic_multi[executing-fix(<=) trim(>=)] ________________ 260s 260s source = .w at 0xeb3016e554e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f15/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": 4}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s False 260s True 260s ________________ test_generic_multi[executing-fix(<=) fix(>=)] _________________ 260s 260s source = .w at 0xeb30176f4fe0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f16/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": 5}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s False 260s False 260s _______________ test_generic_multi[executing-fix(<=) update(>=)] _______________ 260s 260s source = .w at 0xeb30176f5580> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f17/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": 3+2}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s False 260s True 260s _______________ test_generic_multi[executing-fix(<=) create(in)] _______________ 260s 260s source = .w at 0xeb3016adb740> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f18/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 in s["k_1"]) # create -> [5] 260s False 260s True 260s ________________ test_generic_multi[executing-fix(<=) trim(in)] ________________ 260s 260s source = .w at 0xeb30176f51c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f19/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s False 260s True 260s ________________ test_generic_multi[executing-fix(<=) fix(in)] _________________ 260s 260s source = .w at 0xeb30176f6700> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f20/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": []}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s False 260s False 260s _______________ test_generic_multi[executing-fix(<=) update(in)] _______________ 260s 260s source = .w at 0xeb3016adb600> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f21/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 260s |print(5 <= s["k_0"]) # fix 4 -> 5 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s False 260s True 260s _____________ test_generic_multi[executing-update(<=) create(>=)] ______________ 260s 260s source = .w at 0xeb30176f5120> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u12/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 >= s["k_1"]) # create -> 5 260s True 260s True 260s ______________ test_generic_multi[executing-update(<=) trim(>=)] _______________ 260s 260s source = .w at 0xeb30176f77e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u13/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": 4}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s True 260s True 260s _______________ test_generic_multi[executing-update(<=) fix(>=)] _______________ 260s 260s source = .w at 0xeb30176f6660> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u14/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": 5}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s True 260s False 260s _____________ test_generic_multi[executing-update(<=) update(>=)] ______________ 260s 260s source = .w at 0xeb30176f71a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==)]>>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u15/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": 3+2}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s _____________ test_generic_multi[executing-update(<=) create(in)] ______________ 260s 260s source = .w at 0xeb30169f8900> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u16/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # create -> [5] 260s True 260s True 260s ______________ test_generic_multi[executing-update(<=) trim(in)] _______________ 260s 260s source = .w at 0xeb30176f60c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u17/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-update(<=) fix(in)] _______________ 260s 260s source = .w at 0xeb30169f8680> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u18/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": []}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s _____________ test_generic_multi[executing-update(<=) update(in)] ______________ 260s 260s source = .w at 0xeb30169f9940> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u19/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 260s |print(5 <= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s ______________ test_generic_multi[executing-create(>=) trim(>=)] _______________ 260s 260s source = .w at 0xeb3016d2ac00> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) trim(>=)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c25/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 4}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(5 >= s["k_1"]) # trim 4 -> 5 260s True 260s True 260s _______________ test_generic_multi[executing-create(>=) fix(>=)] _______________ 260s 260s source = .w at 0xeb3016d2ab60> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) fix(>=)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c26/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 5}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s True 260s False 260s _____________ test_generic_multi[executing-create(>=) update(>=)] ______________ 260s 260s source = .w at 0xeb3016e56e80> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(>=)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c27/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": 3+2}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s _____________ test_generic_multi[executing-create(>=) create(in)] ______________ 260s 260s source = .w at 0xeb3016e547c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) create(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c28/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(5 in s["k_1"]) # create -> [5] 260s True 260s True 260s ______________ test_generic_multi[executing-create(>=) trim(in)] _______________ 260s 260s source = .w at 0xeb3016d2b1a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) trim(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c29/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [4, 5]}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-create(>=) fix(in)] _______________ 260s 260s source = .w at 0xeb3016adb9c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) fix(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c30/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": []}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s _____________ test_generic_multi[executing-create(>=) update(in)] ______________ 260s 260s source = .w at 0xeb3016ad9440> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c31/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [3+2]}) 260s |print(5 >= s["k_0"]) # create -> 5 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s ________________ test_generic_multi[executing-trim(>=) fix(>=)] ________________ 260s 260s source = .w at 0xeb3016d2b1a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) fix(>=)]>>) 260s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t10/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": 5}) 260s |print(5 >= s["k_0"]) # trim 4 -> 5 260s |print(4 >= s["k_1"]) # fix 5 -> 4 260s True 260s False 260s ______________ test_generic_multi[executing-trim(>=) update(>=)] _______________ 260s 260s source = .w at 0xeb30176f6f20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(>=)]>>) 260s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t11/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": 3+2}) 260s |print(5 >= s["k_0"]) # trim 4 -> 5 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s True 260s True 260s ______________ test_generic_multi[executing-trim(>=) create(in)] _______________ 260s 260s source = .w at 0xeb3016ad9440> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) create(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t12/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4}) 260s |print(5 >= s["k_0"]) # trim 4 -> 5 260s |print(5 in s["k_1"]) # create -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-trim(>=) trim(in)] ________________ 260s 260s source = .w at 0xeb30176f5a80> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) trim(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t13/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 260s |print(5 >= s["k_0"]) # trim 4 -> 5 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s ________________ test_generic_multi[executing-trim(>=) fix(in)] ________________ 260s 260s source = .w at 0xeb30176f4e00> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) fix(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t14/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": []}) 260s |print(5 >= s["k_0"]) # trim 4 -> 5 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s ______________ test_generic_multi[executing-trim(>=) update(in)] _______________ 260s 260s source = .w at 0xeb30176f5800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t15/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 260s |print(5 >= s["k_0"]) # trim 4 -> 5 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-fix(>=) update(>=)] _______________ 260s 260s source = .w at 0xeb3016ad9440> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(>=)]>>) 260s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f22/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": 3+2}) 260s |print(4 >= s["k_0"]) # fix 5 -> 4 260s |print(5 >= s["k_1"]) # update 3+2 -> 5 260s False 260s True 260s _______________ test_generic_multi[executing-fix(>=) create(in)] _______________ 260s 260s source = .w at 0xeb30169f8ea0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) create(in)]>>) 260s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f23/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5}) 260s |print(4 >= s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # create -> [5] 260s False 260s True 260s ________________ test_generic_multi[executing-fix(>=) trim(in)] ________________ 260s 260s source = .w at 0xeb3016ad96c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) trim(in)]>>) 260s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f24/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 260s |print(4 >= s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s False 260s True 260s ________________ test_generic_multi[executing-fix(>=) fix(in)] _________________ 260s 260s source = .w at 0xeb30169fa520> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) fix(in)]>>) 260s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f25/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": []}) 260s |print(4 >= s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s False 260s False 260s _______________ test_generic_multi[executing-fix(>=) update(in)] _______________ 260s 260s source = .w at 0xeb30169faa20> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(in)]>>) 260s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f26/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 260s |print(4 >= s["k_0"]) # fix 5 -> 4 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s False 260s True 260s _____________ test_generic_multi[executing-update(>=) create(in)] ______________ 260s 260s source = .w at 0xeb3016e545e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) create(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u20/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2}) 260s |print(5 >= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # create -> [5] 260s True 260s True 260s ______________ test_generic_multi[executing-update(>=) trim(in)] _______________ 260s 260s source = .w at 0xeb30169fa3e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) trim(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u21/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 260s |print(5 >= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-update(>=) fix(in)] _______________ 260s 260s source = .w at 0xeb30169fb9c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) fix(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u22/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": []}) 260s |print(5 >= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s _____________ test_generic_multi[executing-update(>=) update(in)] ______________ 260s 260s source = .w at 0xeb30169fa3e0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request==) update(in)]>>) 260s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u23/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 260s |print(5 >= s["k_0"]) # update 3+2 -> 5 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s ______________ test_generic_multi[executing-create(in) trim(in)] _______________ 260s 260s source = .w at 0xeb30176f7ba0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 260s to_insert.append((key, new_value_element._new_code())) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '[5 ]' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c32/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [4, 5]}) 260s |print(5 in s["k_0"]) # create -> [5] 260s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-create(in) fix(in)] _______________ 260s 260s source = .w at 0xeb30168a49a0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c33/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": []}) 260s |print(5 in s["k_0"]) # create -> [5] 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s _____________ test_generic_multi[executing-create(in) update(in)] ______________ 260s 260s source = .w at 0xeb30176f7c40> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c34/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_1": [3+2]}) 260s |print(5 in s["k_0"]) # create -> [5] 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s ________________ test_generic_multi[executing-trim(in) fix(in)] ________________ 260s 260s source = .w at 0xeb30168a5620> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t16/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": [4, 5], "k_1": []}) 260s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 260s |print(5 in s["k_1"]) # fix [] -> [5] 260s True 260s False 260s ______________ test_generic_multi[executing-trim(in) update(in)] _______________ 260s 260s source = .w at 0xeb30168a5a80> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t17/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": [4, 5], "k_1": [3+2]}) 260s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s True 260s True 260s _______________ test_generic_multi[executing-fix(in) update(in)] _______________ 260s 260s source = .w at 0xeb30169fa5c0> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx=>, request=>) 260s ops = (operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 260s executing_used = True 260s 260s @pytest.mark.parametrize( 260s "ops", 260s [ 260s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 260s for ops in itertools.combinations(operations, 2) 260s ], 260s ) 260s def test_generic_multi(source, subtests, ops, executing_used): 260s 260s def gen_code(ops, fixed, old_keys): 260s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 260s new_keys = [] 260s 260s args = [] 260s print(keys) 260s for k in keys: 260s op = ops[k] 260s value = op.fvalue if op.flag in fixed else op.svalue 260s if value: 260s args.append(f'"k_{k}": {value}') 260s new_keys.append(k) 260s args = ", ".join(args) 260s 260s code = "s = snapshot({" + args + "})\n" 260s 260s for k, op in enumerate(ops): 260s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 260s 260s return code, new_keys 260s 260s all_flags = {op.flag for op in ops} 260s 260s keys = [] 260s code, keys = gen_code(ops, {}, keys) 260s > s = source(code) 260s 260s tests/test_inline_snapshot.py:141: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 260s yield from self._new_value[key]._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 260s new_code=[self._file._value_to_code(v) for v in new_values], 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f27/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s [0, 1] 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot({"k_0": [], "k_1": [3+2]}) 260s |print(5 in s["k_0"]) # fix [] -> [5] 260s |print(5 in s["k_1"]) # update [3+2] -> [5] 260s False 260s True 260s _____________________________ test_mutable_values ______________________________ 260s 260s check_update = .w at 0xeb3016adbc40> 260s 260s def test_mutable_values(check_update): 260s assert ( 260s > check_update( 260s """ 260s l=[1,2] 260s assert l==snapshot() 260s l.append(3) 260s assert l==snapshot() 260s """, 260s flags="create", 260s number=2, 260s ) 260s == snapshot( 260s """\ 260s 260s l=[1,2] 260s assert l==snapshot([1, 2]) 260s l.append(3) 260s assert l==snapshot([1, 2, 3]) 260s """ 260s ) 260s ) 260s 260s tests/test_inline_snapshot.py:168: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py:11: in 260s assert l==snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s | 260s |l=[1,2] 260s |assert l==snapshot() 260s |l.append(3) 260s |assert l==snapshot() 260s _______________________________ test_comparison ________________________________ 260s 260s check_update = .w at 0xeb30168a5e40> 260s 260s def test_comparison(check_update): 260s > assert check_update("assert 5==snapshot()", flags="create") == snapshot( 260s "assert 5==snapshot(5)" 260s ) 260s 260s tests/test_inline_snapshot.py:257: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py:9: in 260s assert 5==snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5==snapshot() 260s ___________________________________ test_ge ____________________________________ 260s 260s check_update = .w at 0xeb30168a6160> 260s 260s def test_ge(check_update): 260s > assert check_update("assert 5<=snapshot()", flags="create") == snapshot( 260s "assert 5<=snapshot(5)" 260s ) 260s 260s tests/test_inline_snapshot.py:309: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 260s new_code = self._value._new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ge0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5<=snapshot() 260s ___________________________________ test_le ____________________________________ 260s 260s check_update = .w at 0xeb3016ad8a40> 260s 260s def test_le(check_update): 260s > assert check_update("assert 5>=snapshot()", flags="create") == snapshot( 260s "assert 5>=snapshot(5)" 260s ) 260s 260s tests/test_inline_snapshot.py:381: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 260s new_code = self._value._new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_le0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5>=snapshot() 260s ________________________________ test_contains _________________________________ 260s 260s check_update = .w at 0xeb30168a5300> 260s 260s def test_contains(check_update): 260s > assert check_update("assert 5 in snapshot()", flags="create") == snapshot( 260s "assert 5 in snapshot([5])" 260s ) 260s 260s tests/test_inline_snapshot.py:449: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 260s new_code = self._value._new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 260s return self._file._value_to_code(self._new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '[5 ]' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_contains0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 in snapshot() 260s _________________________________ test_getitem _________________________________ 260s 260s check_update = .w at 0xeb30176f5e40> 260s 260s def test_getitem(check_update): 260s > assert check_update('assert 5 == snapshot()["test"]', flags="create") == snapshot( 260s 'assert 5 == snapshot({"test": 5})["test"]' 260s ) 260s 260s tests/test_inline_snapshot.py:492: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py:9: in 260s assert 5 == snapshot()["test"] 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 5 == snapshot()["test"] 260s _________________________________ test_assert __________________________________ 260s 260s check_update = .w at 0xeb30168a5120> 260s 260s def test_assert(check_update): 260s > assert check_update("assert 2 == snapshot(5)", reported_flags="fix") 260s 260s tests/test_inline_snapshot.py:574: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py:9: in 260s assert 2 == snapshot(5) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert 2 == snapshot(5) 260s _______________________________ test_format_file _______________________________ 260s 260s check_update = .w at 0xeb301681c220> 260s 260s def test_format_file(check_update): 260s > assert check_update( 260s 'assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot()\n', flags="create" 260s ) == snapshot( 260s """\ 260s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot([ 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s ]) 260s """ 260s ) 260s 260s tests/test_inline_snapshot.py:588: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py:9: in 260s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 260s ______________________________ test_format_value _______________________________ 260s 260s check_update = .w at 0xeb30176f6f20> 260s 260s def test_format_value(check_update): 260s > assert check_update( 260s 'assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot()\n', flags="create" 260s ) == snapshot( 260s """\ 260s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot([ 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s "aaaaaaaaaaaaaaaaa", 260s ]) 260s """ 260s ) 260s 260s tests/test_inline_snapshot.py:604: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py:9: in 260s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 260s _______________________________ test_type_error ________________________________ 260s 260s check_update = .w at 0xeb30169fbd80> 260s 260s def test_type_error(check_update): 260s tests = ["5 == s", "5 <= s", "5 >= s", "5 in s", "5 == s[0]"] 260s 260s for test1, test2 in itertools.product(tests, tests): 260s with pytest.raises(TypeError) if test1 != test2 else nullcontext() as error: 260s > check_update( 260s f""" 260s s = snapshot() 260s assert {test1} 260s assert {test2} 260s """, 260s reported_flags="create", 260s ) 260s 260s tests/test_inline_snapshot.py:631: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py:11: in 260s assert 5 == s 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s | 260s |s = snapshot() 260s |assert 5 == s 260s |assert 5 == s 260s _________________________ test_different_snapshot_name _________________________ 260s 260s check_update = .w at 0xeb30169fa0c0> 260s 260s def test_different_snapshot_name(check_update): 260s 260s assert ( 260s > check_update( 260s """\ 260s from inline_snapshot import snapshot as s 260s assert 4==s() 260s 260s """, 260s flags="create", 260s ) 260s == snapshot( 260s """\ 260s from inline_snapshot import snapshot as s 260s assert 4==s(4) 260s 260s """ 260s ) 260s ) 260s 260s tests/test_inline_snapshot.py:695: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py:10: in 260s assert 4==s() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |from inline_snapshot import snapshot as s 260s |assert 4==s() 260s | 260s _______________________ test_quoting_change_is_no_update _______________________ 260s 260s source = .w at 0xeb30168a4e00> 260s 260s def test_quoting_change_is_no_update(source): 260s 260s > s = source( 260s """\ 260s from inline_snapshot import external,snapshot 260s 260s class X: 260s def __init__(self,a): 260s self.a=a 260s pass 260s 260s def __repr__(self): 260s return f'X("{self.a}")' 260s 260s def __eq__(self,other): 260s if not hasattr(other,"a"): 260s return NotImplemented 260s return other.a==self.a 260s 260s assert X("a") == snapshot() 260s """ 260s ) 260s 260s tests/test_inline_snapshot.py:731: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py:24: in 260s assert X("a") == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |from inline_snapshot import external,snapshot 260s | 260s |class X: 260s | def __init__(self,a): 260s | self.a=a 260s | pass 260s | 260s | def __repr__(self): 260s | return f'X("{self.a}")' 260s | 260s | def __eq__(self,other): 260s | if not hasattr(other,"a"): 260s | return NotImplemented 260s | return other.a==self.a 260s | 260s |assert X("a") == snapshot() 260s _____________________________ test_trailing_comma ______________________________ 260s 260s project = .Project object at 0xeb301694d640> 260s 260s def test_trailing_comma(project): 260s 260s project.setup( 260s """\ 260s from inline_snapshot import external, snapshot 260s 260s class X: 260s def __init__(self, *args): 260s self.args = args 260s 260s def __repr__(self): 260s return f"X({', '.join(map(repr,self.args))})" 260s 260s def __eq__(self,other): 260s if not isinstance(other,X): 260s return NotImplemented 260s 260s return self.args == other.args 260s 260s def test_thing(): 260s assert X("a" * 40, "a" * 40) == snapshot() 260s """ 260s ) 260s 260s > project.format() 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_inline_snapshot.py:805: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py:315: in format 260s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\nfrom inline_snapshot import ext...ented\n\n return self.args == other.args\n\ndef test_thing():\n assert X("a" * 40, "a" * 40) == snapshot()\n' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_trailing_comma0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s from inline_snapshot import external, snapshot 260s 260s class X: 260s def __init__(self, *args): 260s self.args = args 260s 260s def __repr__(self): 260s return f"X({', '.join(map(repr,self.args))})" 260s 260s def __eq__(self,other): 260s if not isinstance(other,X): 260s return NotImplemented 260s 260s return self.args == other.args 260s 260s def test_thing(): 260s assert X("a" * 40, "a" * 40) == snapshot() 260s 260s ___________________________________ test_is ____________________________________ 260s 260s def test_is(): 260s 260s Example( 260s """ 260s from inline_snapshot import snapshot,Is 260s 260s def test_Is(): 260s for i in range(3): 260s assert ["hello",i] == snapshot(["hi",Is(i)]) 260s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s 260s from inline_snapshot import snapshot,Is 260s 260s def test_Is(): 260s for i in range(3): 260s assert ["hello",i] == snapshot(["hi",Is(i)]) 260s assert ["hello",i] == snapshot({1:["hi",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 260s """ 260s } 260s ), 260s ).run_inline( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s 260s from inline_snapshot import snapshot,Is 260s 260s def test_Is(): 260s for i in range(3): 260s assert ["hello",i] == snapshot(["hello",Is(i)]) 260s assert ["hello",i] == snapshot({1:["hello",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_inline_snapshot.py:912: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s 260s from inline_snapshot import snapshot,Is 260s 260s def test_Is(): 260s for i in range(3): 260s assert ["hello",i] == snapshot(["hi",Is(i)]) 260s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 260s 260s 260s run> pytest /tmp/tmp9phqbm5k/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmp9phqbm5k/test_something.py", line 6, in test_Is 260s assert ["hello",i] == snapshot(["hi",Is(i)]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 260s v = yield from self.get_adapter( 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s _______________________________ test_missing_is ________________________________ 260s 260s def test_missing_is(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s 260s def test_is(): 260s for i in (1,2): 260s assert i == snapshot(i) 260s """ 260s > ).run_inline( 260s raises=snapshot( 260s """\ 260s UsageError: 260s snapshot value should not change. Use Is(...) for dynamic snapshot parts.\ 260s """ 260s ) 260s ) 260s 260s tests/test_is.py:15: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 260s assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_is.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s def test_is(): 260s for i in (1,2): 260s assert i == snapshot(i) 260s 260s 260s run> pytest /tmp/tmpynrspvsv/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpynrspvsv/test_something.py", line 5, in test_is 260s assert i == snapshot(i) 260s ^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s __________________________________ test_repr ___________________________________ 260s 260s def test_repr(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from tests._is_normalized import IsNormalized 260s 260s def test_a(): 260s n=IsNormalized(sorted,snapshot()) 260s assert [3,5,2] == n 260s assert repr(n)==snapshot() 260s """ 260s > ).run_inline( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from tests._is_normalized import IsNormalized 260s 260s def test_a(): 260s n=IsNormalized(sorted,snapshot([2, 3, 5])) 260s assert [3,5,2] == n 260s assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])") 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_is_normalized.py:16: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_inline( 260s self, 260s args: list[str] = [], 260s *, 260s reported_categories: Snapshot[list[Category]] | None = None, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s raises: Snapshot[str] | None = None, 260s ) -> Example: 260s """Execute the example files in process and run every `test_*` 260s function. 260s 260s This is useful for fast test execution. 260s 260s Parameters: 260s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 260s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 260s changed_files: snapshot of files which are changed by this run. 260s raises: snapshot of the exception which is raised during the test execution. 260s It is required if your code raises an exception. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s parser = ArgumentParser() 260s 260s parser.add_argument( 260s "--inline-snapshot", 260s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 260s dest="inline_snapshot", 260s help="update specific snapshot values:\n" 260s "disable: disable the snapshot logic\n" 260s "short-report: show a short report\n" 260s "report: show a longer report with a diff report\n" 260s "review: allow to approve the changes interactive\n" 260s "create: creates snapshots which are currently not defined\n" 260s "update: update snapshots even if they are defined\n" 260s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 260s "fix: change snapshots which currently break your tests\n", 260s ) 260s parsed_args = parser.parse_args(args) 260s flags = (parsed_args.inline_snapshot or "").split(",") 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s 260s self._write_files(tmp_path) 260s 260s raised_exception = None 260s with snapshot_env(): 260s with ChangeRecorder().activate() as recorder: 260s _inline_snapshot._update_flags = Flags({*flags}) 260s inline_snapshot._external.storage = ( 260s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 260s ) 260s 260s try: 260s for filename in tmp_path.glob("*.py"): 260s globals: dict[str, Any] = {} 260s print("run> pytest", filename) 260s exec( 260s compile(filename.read_text("utf-8"), filename, "exec"), 260s globals, 260s ) 260s 260s # run all test_* functions 260s for k, v in globals.items(): 260s if k.startswith("test_") and callable(v): 260s v() 260s except Exception as e: 260s traceback.print_exc() 260s raised_exception = e 260s 260s finally: 260s _inline_snapshot._active = False 260s 260s changes = [] 260s for snapshot in _inline_snapshot.snapshots.values(): 260s changes += snapshot._changes() 260s 260s snapshot_flags = {change.flag for change in changes} 260s 260s apply_all( 260s [ 260s change 260s for change in changes 260s if change.flag in _inline_snapshot._update_flags.to_set() 260s ] 260s ) 260s recorder.fix_all() 260s 260s report_output = StringIO() 260s console = Console(file=report_output) 260s 260s # TODO: add all the report output here 260s report_problems(console) 260s 260s if reported_categories is not None: 260s assert sorted(snapshot_flags) == reported_categories 260s 260s if raised_exception is not None: 260s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 260s raised_exception 260s ) 260s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 260s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from tests._is_normalized import IsNormalized 260s 260s def test_a(): 260s n=IsNormalized(sorted,snapshot()) 260s assert [3,5,2] == n 260s assert repr(n)==snapshot() 260s 260s 260s run> pytest /tmp/tmpeji3vg5l/test_something.py 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 260s v() 260s File "/tmp/tmpeji3vg5l/test_something.py", line 6, in test_a 260s assert [3,5,2] == n 260s ^^^^^^^^^^^^ 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/_is_normalized.py", line 13, in __eq__ 260s return self._last_value == self._value 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 260s return self == other 260s ^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 260s self._changes.append(next(it)) 260s ^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 260s new_code = self.context.file._token_to_code(new_token) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 260s return format_code(text, Path(self._source.filename)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ______________________________ test_fix_list_fix _______________________________ 260s 260s check_update = .w at 0xeb301681d800> 260s 260s def test_fix_list_fix(check_update): 260s > assert check_update( 260s """assert [1,2]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix" 260s ) == snapshot("assert [1,2]==snapshot([0+1,2])") 260s 260s tests/test_preserve_values.py:9: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py:9: in 260s assert [1,2]==snapshot([0+1,3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [1,2]==snapshot([0+1,3]) 260s _____________________________ test_fix_list_insert _____________________________ 260s 260s check_update = .w at 0xeb301681ff60> 260s 260s def test_fix_list_insert(check_update): 260s > assert check_update( 260s """assert [1,2,3,4,5,6]==snapshot([0+1,3])""", 260s reported_flags="update,fix", 260s flags="fix", 260s ) == snapshot("assert [1,2,3,4,5,6]==snapshot([0+1, 2, 3, 4, 5, 6])") 260s 260s tests/test_preserve_values.py:15: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py:9: in 260s assert [1,2,3,4,5,6]==snapshot([0+1,3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [1,2,3,4,5,6]==snapshot([0+1,3]) 260s _____________________________ test_fix_list_delete _____________________________ 260s 260s check_update = .w at 0xeb301681c0e0> 260s 260s def test_fix_list_delete(check_update): 260s > assert check_update( 260s """assert [1,5]==snapshot([0+1,2,3,4,5])""", 260s reported_flags="update,fix", 260s flags="fix", 260s ) == snapshot("assert [1,5]==snapshot([0+1, 5])") 260s 260s tests/test_preserve_values.py:23: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py:9: in 260s assert [1,5]==snapshot([0+1,2,3,4,5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [1,5]==snapshot([0+1,2,3,4,5]) 260s ____________________________ test_fix_tuple_delete _____________________________ 260s 260s check_update = .w at 0xeb3016856480> 260s 260s def test_fix_tuple_delete(check_update): 260s > assert check_update( 260s """assert (1,5)==snapshot((0+1,2,3,4,5))""", 260s reported_flags="update,fix", 260s flags="fix", 260s ) == snapshot("assert (1,5)==snapshot((0+1, 5))") 260s 260s tests/test_preserve_values.py:31: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py:9: in 260s assert (1,5)==snapshot((0+1,2,3,4,5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (1,5)==snapshot((0+1,2,3,4,5)) 260s _____________________________ test_fix_dict_change _____________________________ 260s 260s check_update = .w at 0xeb30168567a0> 260s 260s def test_fix_dict_change(check_update): 260s > assert check_update( 260s """assert {1:1, 2:2}==snapshot({1:0+1, 2:3})""", 260s reported_flags="update,fix", 260s flags="fix", 260s ) == snapshot("assert {1:1, 2:2}==snapshot({1:0+1, 2:2})") 260s 260s tests/test_preserve_values.py:39: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py:9: in 260s assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 260s _____________________________ test_fix_dict_remove _____________________________ 260s 260s check_update = .w at 0xeb301681c0e0> 260s 260s def test_fix_dict_remove(check_update): 260s > assert check_update( 260s """assert {1:1}==snapshot({0:0, 1:0+1, 2:2})""", 260s reported_flags="update,fix", 260s flags="fix", 260s ) == snapshot("assert {1:1}==snapshot({1:0+1})") 260s 260s tests/test_preserve_values.py:47: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py:9: in 260s assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 260s _____________________________ test_fix_dict_insert _____________________________ 260s 260s check_update = .w at 0xeb30168563e0> 260s 260s def test_fix_dict_insert(check_update): 260s > assert check_update( 260s """assert {0:"before",1:1,2:"after"}==snapshot({1:0+1})""", 260s reported_flags="update,fix", 260s flags="fix", 260s ) == snapshot( 260s 'assert {0:"before",1:1,2:"after"}==snapshot({0: "before", 1:0+1, 2: "after"})' 260s ) 260s 260s tests/test_preserve_values.py:61: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py:9: in 260s assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 260s _____________________ test_fix_dict_with_non_literal_keys ______________________ 260s 260s check_update = .w at 0xeb3016855760> 260s 260s def test_fix_dict_with_non_literal_keys(check_update): 260s > assert check_update( 260s """assert {1+2:"3"}==snapshot({1+2:"5"})""", 260s reported_flags="fix", 260s flags="fix", 260s ) == snapshot('assert {1+2:"3"}==snapshot({1+2:"3"})') 260s 260s tests/test_preserve_values.py:71: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py:9: in 260s assert {1+2:"3"}==snapshot({1+2:"5"}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'3'" 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1+2:"3"}==snapshot({1+2:"5"}) 260s _______________________ test_no_update_for_dirty_equals ________________________ 260s 260s check_update = .w at 0xeb3016854180> 260s 260s @pytest.mark.skipif( 260s sys.version_info < (3, 8), reason="dirty equals has dropped the 3.7 support" 260s ) 260s def test_no_update_for_dirty_equals(check_update): 260s assert ( 260s > check_update( 260s """\ 260s from dirty_equals import IsInt 260s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 260s """, 260s reported_flags="update", 260s flags="update", 260s ) 260s == snapshot( 260s """\ 260s from dirty_equals import IsInt 260s assert {5:5,2:2}==snapshot({5:IsInt(),2:2}) 260s """ 260s ) 260s ) 260s 260s tests/test_preserve_values.py:83: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py:10: in 260s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |from dirty_equals import IsInt 260s |assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 260s _____________________ test_preserve_case_from_original_mr ______________________ 260s 260s check_update = .w at 0xeb3016854f40> 260s 260s def test_preserve_case_from_original_mr(check_update): 260s assert ( 260s > check_update( 260s """\ 260s left = { 260s "a": 1, 260s "b": { 260s "c": 2, 260s "d": [ 260s 3, 260s 4, 260s 5, 260s ], 260s }, 260s "e": ( 260s { 260s "f": 6, 260s "g": 7, 260s }, 260s ), 260s } 260s assert left == snapshot( 260s { 260s "a": 10, 260s "b": { 260s "c": 2 * 1 + 0, 260s "d": [ 260s int(3), 260s 40, 260s 5, 260s ], 260s "h": 8, 260s }, 260s "e": ( 260s { 260s "f": 3 + 3, 260s }, 260s 9, 260s ), 260s } 260s ) 260s """, 260s reported_flags="update,fix", 260s flags="fix", 260s ) 260s == snapshot( 260s """\ 260s left = { 260s "a": 1, 260s "b": { 260s "c": 2, 260s "d": [ 260s 3, 260s 4, 260s 5, 260s ], 260s }, 260s "e": ( 260s { 260s "f": 6, 260s "g": 7, 260s }, 260s ), 260s } 260s assert left == snapshot( 260s { 260s "a": 1, 260s "b": { 260s "c": 2 * 1 + 0, 260s "d": [ 260s int(3), 260s 4, 260s 5, 260s ]}, 260s "e": ({"f": 6, "g": 7},), 260s } 260s ) 260s """ 260s ) 260s ) 260s 260s tests/test_preserve_values.py:103: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py:26: in 260s assert left == snapshot( 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |left = { 260s | "a": 1, 260s | "b": { 260s | "c": 2, 260s | "d": [ 260s | 3, 260s | 4, 260s | 5, 260s | ], 260s | }, 260s | "e": ( 260s | { 260s | "f": 6, 260s | "g": 7, 260s | }, 260s | ), 260s |} 260s |assert left == snapshot( 260s | { 260s | "a": 10, 260s | "b": { 260s | "c": 2 * 1 + 0, 260s | "d": [ 260s | int(3), 260s | 40, 260s | 5, 260s | ], 260s | "h": 8, 260s | }, 260s | "e": ( 260s | { 260s | "f": 3 + 3, 260s | }, 260s | 9, 260s | ), 260s | } 260s |) 260s _____________________ test_generic [[5, 5, 5] -> [] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert []==snapshot([5, 5, 5])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_3.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert []==snapshot([5, 5, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert []==snapshot([5, 5, 5]) 260s source: assert []==snapshot([5, 5, 5]) 260s set(): 260s assert []==snapshot([5, 5, 5]) 260s assert []==snapshot([5, 5, 5]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert []==snapshot([5, 5, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert []==snapshot([5, 5, 5]) 260s {'fix'}: 260s assert []==snapshot([5, 5, 5]) 260s assert []==snapshot([]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert []==snapshot([5, 5, 5]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_1.py", line 9, in 260s assert []==snapshot([5, 5, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_2.py", line 9, in 260s assert []==snapshot([5, 5, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py:9: in 260s assert [8]==snapshot([5, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8]==snapshot([5, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[5, 5, 2+2] -> [4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py:9: in 260s assert [4]==snapshot([5, 5, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4]==snapshot([5, 5, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[5, 5, 3] -> [3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert [3]==snapshot([5, 5, 3])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_8.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([5, 5, 3]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3]==snapshot([5, 5, 3]) 260s source: assert [3]==snapshot([5, 5, 3]) 260s set(): 260s assert [3]==snapshot([5, 5, 3]) 260s assert [3]==snapshot([5, 5, 3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([5, 5, 3]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3]==snapshot([5, 5, 3]) 260s {'fix'}: 260s assert [3]==snapshot([5, 5, 3]) 260s assert [3]==snapshot([3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([5, 5, 3]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_6.py", line 9, in 260s assert [3]==snapshot([5, 5, 3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_7.py", line 9, in 260s assert [3]==snapshot([5, 5, 3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py:9: in 260s assert [8]==snapshot([5, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8]==snapshot([5, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py:9: in 260s assert [8, 8]==snapshot([5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 8]==snapshot([5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py:9: in 260s assert [8, 4]==snapshot([5, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 4]==snapshot([5, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py:9: in 260s assert [8, 3]==snapshot([5, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 3]==snapshot([5, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[5, 2+2, 5] -> [4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py:9: in 260s assert [4]==snapshot([5, 2+2, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4]==snapshot([5, 2+2, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[5, 2+2] -> [4, 8] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py:9: in 260s assert [4, 8]==snapshot([5, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 8]==snapshot([5, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[5, 2+2, 2+2] -> [4, 4] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py:9: in 260s assert [4, 4]==snapshot([5, 2+2, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 4]==snapshot([5, 2+2, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[5, 2+2, 3] -> [4, 3] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py:9: in 260s assert [4, 3]==snapshot([5, 2+2, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 3]==snapshot([5, 2+2, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[5, 3, 5] -> [3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert [3]==snapshot([5, 3, 5])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_19.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([5, 3, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3]==snapshot([5, 3, 5]) 260s source: assert [3]==snapshot([5, 3, 5]) 260s set(): 260s assert [3]==snapshot([5, 3, 5]) 260s assert [3]==snapshot([5, 3, 5]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([5, 3, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3]==snapshot([5, 3, 5]) 260s {'fix'}: 260s assert [3]==snapshot([5, 3, 5]) 260s assert [3]==snapshot([3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([5, 3, 5]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_17.py", line 9, in 260s assert [3]==snapshot([5, 3, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_18.py", line 9, in 260s assert [3]==snapshot([5, 3, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[5, 3] -> [3, 8] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py:9: in 260s assert [3, 8]==snapshot([5, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 8]==snapshot([5, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[5, 3, 2+2] -> [3, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py:9: in 260s assert [3, 4]==snapshot([5, 3, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 4]==snapshot([5, 3, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [[5, 3, 3] -> [3, 3] ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert [3, 3]==snapshot([5, 3, 3])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_24.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([5, 3, 3]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3, 3]==snapshot([5, 3, 3]) 260s source: assert [3, 3]==snapshot([5, 3, 3]) 260s set(): 260s assert [3, 3]==snapshot([5, 3, 3]) 260s assert [3, 3]==snapshot([5, 3, 3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([5, 3, 3]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3, 3]==snapshot([5, 3, 3]) 260s {'fix'}: 260s assert [3, 3]==snapshot([5, 3, 3]) 260s assert [3, 3]==snapshot([3, 3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([5, 3, 3]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_22.py", line 9, in 260s assert [3, 3]==snapshot([5, 3, 3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_23.py", line 9, in 260s assert [3, 3]==snapshot([5, 3, 3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py:9: in 260s assert [8]==snapshot([5, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8]==snapshot([5, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py:9: in 260s assert [8, 8]==snapshot([5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 8]==snapshot([5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py:9: in 260s assert [8, 4]==snapshot([5, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 4]==snapshot([5, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py:9: in 260s assert [8, 3]==snapshot([5, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 3]==snapshot([5, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py:9: in 260s assert [8, 8]==snapshot([5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 8]==snapshot([5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [[] -> [8, 8, 8] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py:9: in 260s assert [8, 8, 8]==snapshot([]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 8, 8]==snapshot([]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2] -> [8, 8, 4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py:9: in 260s assert [8, 8, 4]==snapshot([2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 8, 4]==snapshot([2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3] -> [8, 8, 3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py:9: in 260s assert [8, 8, 3]==snapshot([3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 8, 3]==snapshot([3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2, 5] -> [8, 4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py:9: in 260s assert [8, 4]==snapshot([2+2, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 4]==snapshot([2+2, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2] -> [8, 4, 8] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py:9: in 260s assert [8, 4, 8]==snapshot([2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 4, 8]==snapshot([2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[2+2, 2+2] -> [8, 4, 4] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py:9: in 260s assert [8, 4, 4]==snapshot([2+2, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 4, 4]==snapshot([2+2, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 3] -> [8, 4, 3] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py:9: in 260s assert [8, 4, 3]==snapshot([2+2, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 4, 3]==snapshot([2+2, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3, 5] -> [8, 3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py:9: in 260s assert [8, 3]==snapshot([3, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 3]==snapshot([3, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3] -> [8, 3, 8] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py:9: in 260s assert [8, 3, 8]==snapshot([3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 3, 8]==snapshot([3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[3, 2+2] -> [8, 3, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py:9: in 260s assert [8, 3, 4]==snapshot([3, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 3, 4]==snapshot([3, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [[3, 3] -> [8, 3, 3] ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py:9: in 260s assert [8, 3, 3]==snapshot([3, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [8, 3, 3]==snapshot([3, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2, 5, 5] -> [4] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py:9: in 260s assert [4]==snapshot([2+2, 5, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4]==snapshot([2+2, 5, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py:9: in 260s assert [4, 8]==snapshot([2+2, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 8]==snapshot([2+2, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[2+2, 5, 2+2] -> [4, 4] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py:9: in 260s assert [4, 4]==snapshot([2+2, 5, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 4]==snapshot([2+2, 5, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 5, 3] -> [4, 3] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py:9: in 260s assert [4, 3]==snapshot([2+2, 5, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 3]==snapshot([2+2, 5, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py:9: in 260s assert [4, 8]==snapshot([2+2, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 8]==snapshot([2+2, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2] -> [4, 8, 8] ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py:9: in 260s assert [4, 8, 8]==snapshot([2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 8, 8]==snapshot([2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[2+2, 2+2] -> [4, 8, 4] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py:9: in 260s assert [4, 8, 4]==snapshot([2+2, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 8, 4]==snapshot([2+2, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 3] -> [4, 8, 3] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py:9: in 260s assert [4, 8, 3]==snapshot([2+2, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 8, 3]==snapshot([2+2, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[2+2, 2+2, 5] -> [4, 4] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py:9: in 260s assert [4, 4]==snapshot([2+2, 2+2, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 4]==snapshot([2+2, 2+2, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[2+2, 2+2] -> [4, 4, 8] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py:9: in 260s assert [4, 4, 8]==snapshot([2+2, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 4, 8]==snapshot([2+2, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py:9: in 260s assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py:9: in 260s assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 3, 5] -> [4, 3] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py:9: in 260s assert [4, 3]==snapshot([2+2, 3, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 3]==snapshot([2+2, 3, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 3] -> [4, 3, 8] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py:9: in 260s assert [4, 3, 8]==snapshot([2+2, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 3, 8]==snapshot([2+2, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py:9: in 260s assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[2+2, 3, 3] -> [4, 3, 3] ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py:9: in 260s assert [4, 3, 3]==snapshot([2+2, 3, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [4, 3, 3]==snapshot([2+2, 3, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3, 5, 5] -> [3] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert [3]==snapshot([3, 5, 5])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_59.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([3, 5, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3]==snapshot([3, 5, 5]) 260s source: assert [3]==snapshot([3, 5, 5]) 260s set(): 260s assert [3]==snapshot([3, 5, 5]) 260s assert [3]==snapshot([3, 5, 5]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([3, 5, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3]==snapshot([3, 5, 5]) 260s {'fix'}: 260s assert [3]==snapshot([3, 5, 5]) 260s assert [3]==snapshot([3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3]==snapshot([3, 5, 5]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_57.py", line 9, in 260s assert [3]==snapshot([3, 5, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_58.py", line 9, in 260s assert [3]==snapshot([3, 5, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py:9: in 260s assert [3, 8]==snapshot([3, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 8]==snapshot([3, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[3, 5, 2+2] -> [3, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py:9: in 260s assert [3, 4]==snapshot([3, 5, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 4]==snapshot([3, 5, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [[3, 5, 3] -> [3, 3] ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert [3, 3]==snapshot([3, 5, 3])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_64.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([3, 5, 3]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3, 3]==snapshot([3, 5, 3]) 260s source: assert [3, 3]==snapshot([3, 5, 3]) 260s set(): 260s assert [3, 3]==snapshot([3, 5, 3]) 260s assert [3, 3]==snapshot([3, 5, 3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([3, 5, 3]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3, 3]==snapshot([3, 5, 3]) 260s {'fix'}: 260s assert [3, 3]==snapshot([3, 5, 3]) 260s assert [3, 3]==snapshot([3, 3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([3, 5, 3]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_62.py", line 9, in 260s assert [3, 3]==snapshot([3, 5, 3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_63.py", line 9, in 260s assert [3, 3]==snapshot([3, 5, 3]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py:9: in 260s assert [3, 8]==snapshot([3, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 8]==snapshot([3, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [[3] -> [3, 8, 8] ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py:9: in 260s assert [3, 8, 8]==snapshot([3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 8, 8]==snapshot([3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[3, 2+2] -> [3, 8, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py:9: in 260s assert [3, 8, 4]==snapshot([3, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 8, 4]==snapshot([3, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [[3, 3] -> [3, 8, 3] ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py:9: in 260s assert [3, 8, 3]==snapshot([3, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 8, 3]==snapshot([3, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[3, 2+2, 5] -> [3, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py:9: in 260s assert [3, 4]==snapshot([3, 2+2, 5]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 4]==snapshot([3, 2+2, 5]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[3, 2+2] -> [3, 4, 8] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py:9: in 260s assert [3, 4, 8]==snapshot([3, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 4, 8]==snapshot([3, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py:9: in 260s assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[3, 2+2, 3] -> [3, 4, 3] ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py:9: in 260s assert [3, 4, 3]==snapshot([3, 2+2, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 4, 3]==snapshot([3, 2+2, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [[3, 3, 5] -> [3, 3] ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert [3, 3]==snapshot([3, 3, 5])' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_75.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([3, 3, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3, 3]==snapshot([3, 3, 5]) 260s source: assert [3, 3]==snapshot([3, 3, 5]) 260s set(): 260s assert [3, 3]==snapshot([3, 3, 5]) 260s assert [3, 3]==snapshot([3, 3, 5]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([3, 3, 5]) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert [3, 3]==snapshot([3, 3, 5]) 260s {'fix'}: 260s assert [3, 3]==snapshot([3, 3, 5]) 260s assert [3, 3]==snapshot([3, 3]) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3]==snapshot([3, 3, 5]) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_73.py", line 9, in 260s assert [3, 3]==snapshot([3, 3, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_74.py", line 9, in 260s assert [3, 3]==snapshot([3, 3, 5]) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [[3, 3] -> [3, 3, 8] ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py:9: in 260s assert [3, 3, 8]==snapshot([3, 3]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3, 8]==snapshot([3, 3]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [[3, 3, 2+2] -> [3, 3, 4] ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py:9: in 260s assert [3, 3, 4]==snapshot([3, 3, 2+2]) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert [3, 3, 4]==snapshot([3, 3, 2+2]) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5, 5, 5) -> () ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert ()==snapshot((5, 5, 5))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_82.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert ()==snapshot((5, 5, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert ()==snapshot((5, 5, 5)) 260s source: assert ()==snapshot((5, 5, 5)) 260s set(): 260s assert ()==snapshot((5, 5, 5)) 260s assert ()==snapshot((5, 5, 5)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert ()==snapshot((5, 5, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert ()==snapshot((5, 5, 5)) 260s {'fix'}: 260s assert ()==snapshot((5, 5, 5)) 260s assert ()==snapshot(()) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert ()==snapshot((5, 5, 5)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_80.py", line 9, in 260s assert ()==snapshot((5, 5, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_81.py", line 9, in 260s assert ()==snapshot((5, 5, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py:9: in 260s assert (8,)==snapshot((5, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8,)==snapshot((5, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(5, 5, 2+2) -> (4,) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py:9: in 260s assert (4,)==snapshot((5, 5, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4,)==snapshot((5, 5, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(5, 5, 3) -> (3,) ] ____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert (3,)==snapshot((5, 5, 3))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_87.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((5, 5, 3)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3,)==snapshot((5, 5, 3)) 260s source: assert (3,)==snapshot((5, 5, 3)) 260s set(): 260s assert (3,)==snapshot((5, 5, 3)) 260s assert (3,)==snapshot((5, 5, 3)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((5, 5, 3)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3,)==snapshot((5, 5, 3)) 260s {'fix'}: 260s assert (3,)==snapshot((5, 5, 3)) 260s assert (3,)==snapshot((3,)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((5, 5, 3)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_85.py", line 9, in 260s assert (3,)==snapshot((5, 5, 3)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_86.py", line 9, in 260s assert (3,)==snapshot((5, 5, 3)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py:9: in 260s assert (8,)==snapshot((5, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8,)==snapshot((5, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py:9: in 260s assert (8, 8)==snapshot((5,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 8)==snapshot((5,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py:9: in 260s assert (8, 4)==snapshot((5, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 4)==snapshot((5, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py:9: in 260s assert (8, 3)==snapshot((5, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 3)==snapshot((5, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(5, 2+2, 5) -> (4,) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py:9: in 260s assert (4,)==snapshot((5, 2+2, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4,)==snapshot((5, 2+2, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(5, 2+2) -> (4, 8) ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py:9: in 260s assert (4, 8)==snapshot((5, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 8)==snapshot((5, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(5, 2+2, 2+2) -> (4, 4) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py:9: in 260s assert (4, 4)==snapshot((5, 2+2, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 4)==snapshot((5, 2+2, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(5, 2+2, 3) -> (4, 3) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py:9: in 260s assert (4, 3)==snapshot((5, 2+2, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 3)==snapshot((5, 2+2, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(5, 3, 5) -> (3,) ] ____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert (3,)==snapshot((5, 3, 5))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_98.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((5, 3, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3,)==snapshot((5, 3, 5)) 260s source: assert (3,)==snapshot((5, 3, 5)) 260s set(): 260s assert (3,)==snapshot((5, 3, 5)) 260s assert (3,)==snapshot((5, 3, 5)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((5, 3, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3,)==snapshot((5, 3, 5)) 260s {'fix'}: 260s assert (3,)==snapshot((5, 3, 5)) 260s assert (3,)==snapshot((3,)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((5, 3, 5)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_96.py", line 9, in 260s assert (3,)==snapshot((5, 3, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_97.py", line 9, in 260s assert (3,)==snapshot((5, 3, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(5, 3) -> (3, 8) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py:9: in 260s assert (3, 8)==snapshot((5, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 8)==snapshot((5, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(5, 3, 2+2) -> (3, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py:9: in 260s assert (3, 4)==snapshot((5, 3, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 4)==snapshot((5, 3, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [(5, 3, 3) -> (3, 3) ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert (3, 3)==snapshot((5, 3, 3))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_103.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((5, 3, 3)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3, 3)==snapshot((5, 3, 3)) 260s source: assert (3, 3)==snapshot((5, 3, 3)) 260s set(): 260s assert (3, 3)==snapshot((5, 3, 3)) 260s assert (3, 3)==snapshot((5, 3, 3)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((5, 3, 3)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3, 3)==snapshot((5, 3, 3)) 260s {'fix'}: 260s assert (3, 3)==snapshot((5, 3, 3)) 260s assert (3, 3)==snapshot((3, 3)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((5, 3, 3)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_101.py", line 9, in 260s assert (3, 3)==snapshot((5, 3, 3)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_102.py", line 9, in 260s assert (3, 3)==snapshot((5, 3, 3)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py:9: in 260s assert (8,)==snapshot((5, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8,)==snapshot((5, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py:9: in 260s assert (8, 8)==snapshot((5,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 8)==snapshot((5,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py:9: in 260s assert (8, 4)==snapshot((5, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 4)==snapshot((5, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py:9: in 260s assert (8, 3)==snapshot((5, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 3)==snapshot((5, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py:9: in 260s assert (8, 8)==snapshot((5,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 8)==snapshot((5,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________________ test_generic [() -> (8, 8, 8) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py:9: in 260s assert (8, 8, 8)==snapshot(()) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 8, 8)==snapshot(()) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2,) -> (8, 8, 4) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py:9: in 260s assert (8, 8, 4)==snapshot((2+2,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 8, 4)==snapshot((2+2,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3,) -> (8, 8, 3) ] ____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py:9: in 260s assert (8, 8, 3)==snapshot((3,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 8, 3)==snapshot((3,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2, 5) -> (8, 4) ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py:9: in 260s assert (8, 4)==snapshot((2+2, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 4)==snapshot((2+2, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2,) -> (8, 4, 8) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py:9: in 260s assert (8, 4, 8)==snapshot((2+2,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 4, 8)==snapshot((2+2,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(2+2, 2+2) -> (8, 4, 4) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py:9: in 260s assert (8, 4, 4)==snapshot((2+2, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 4, 4)==snapshot((2+2, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 3) -> (8, 4, 3) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py:9: in 260s assert (8, 4, 3)==snapshot((2+2, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 4, 3)==snapshot((2+2, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3, 5) -> (8, 3) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py:9: in 260s assert (8, 3)==snapshot((3, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 3)==snapshot((3, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3,) -> (8, 3, 8) ] ____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py:9: in 260s assert (8, 3, 8)==snapshot((3,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 3, 8)==snapshot((3,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(3, 2+2) -> (8, 3, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py:9: in 260s assert (8, 3, 4)==snapshot((3, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 3, 4)==snapshot((3, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [(3, 3) -> (8, 3, 3) ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py:9: in 260s assert (8, 3, 3)==snapshot((3, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (8, 3, 3)==snapshot((3, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2, 5, 5) -> (4,) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py:9: in 260s assert (4,)==snapshot((2+2, 5, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4,)==snapshot((2+2, 5, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py:9: in 260s assert (4, 8)==snapshot((2+2, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 8)==snapshot((2+2, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(2+2, 5, 2+2) -> (4, 4) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py:9: in 260s assert (4, 4)==snapshot((2+2, 5, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 4)==snapshot((2+2, 5, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 5, 3) -> (4, 3) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py:9: in 260s assert (4, 3)==snapshot((2+2, 5, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 3)==snapshot((2+2, 5, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py:9: in 260s assert (4, 8)==snapshot((2+2, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 8)==snapshot((2+2, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2,) -> (4, 8, 8) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py:9: in 260s assert (4, 8, 8)==snapshot((2+2,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 8, 8)==snapshot((2+2,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(2+2, 2+2) -> (4, 8, 4) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py:9: in 260s assert (4, 8, 4)==snapshot((2+2, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 8, 4)==snapshot((2+2, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 3) -> (4, 8, 3) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py:9: in 260s assert (4, 8, 3)==snapshot((2+2, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 8, 3)==snapshot((2+2, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(2+2, 2+2, 5) -> (4, 4) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py:9: in 260s assert (4, 4)==snapshot((2+2, 2+2, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 4)==snapshot((2+2, 2+2, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(2+2, 2+2) -> (4, 4, 8) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py:9: in 260s assert (4, 4, 8)==snapshot((2+2, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 4, 8)==snapshot((2+2, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____________ test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] _____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py:9: in 260s assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py:9: in 260s assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 3, 5) -> (4, 3) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py:9: in 260s assert (4, 3)==snapshot((2+2, 3, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 3)==snapshot((2+2, 3, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 3) -> (4, 3, 8) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py:9: in 260s assert (4, 3, 8)==snapshot((2+2, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 3, 8)==snapshot((2+2, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py:9: in 260s assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(2+2, 3, 3) -> (4, 3, 3) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py:9: in 260s assert (4, 3, 3)==snapshot((2+2, 3, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (4, 3, 3)==snapshot((2+2, 3, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3, 5, 5) -> (3,) ] ____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert (3,)==snapshot((3, 5, 5))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_138.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((3, 5, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3,)==snapshot((3, 5, 5)) 260s source: assert (3,)==snapshot((3, 5, 5)) 260s set(): 260s assert (3,)==snapshot((3, 5, 5)) 260s assert (3,)==snapshot((3, 5, 5)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((3, 5, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3,)==snapshot((3, 5, 5)) 260s {'fix'}: 260s assert (3,)==snapshot((3, 5, 5)) 260s assert (3,)==snapshot((3,)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3,)==snapshot((3, 5, 5)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_136.py", line 9, in 260s assert (3,)==snapshot((3, 5, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_137.py", line 9, in 260s assert (3,)==snapshot((3, 5, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py:9: in 260s assert (3, 8)==snapshot((3, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 8)==snapshot((3, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(3, 5, 2+2) -> (3, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py:9: in 260s assert (3, 4)==snapshot((3, 5, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 4)==snapshot((3, 5, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [(3, 5, 3) -> (3, 3) ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert (3, 3)==snapshot((3, 5, 3))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_143.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((3, 5, 3)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3, 3)==snapshot((3, 5, 3)) 260s source: assert (3, 3)==snapshot((3, 5, 3)) 260s set(): 260s assert (3, 3)==snapshot((3, 5, 3)) 260s assert (3, 3)==snapshot((3, 5, 3)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((3, 5, 3)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3, 3)==snapshot((3, 5, 3)) 260s {'fix'}: 260s assert (3, 3)==snapshot((3, 5, 3)) 260s assert (3, 3)==snapshot((3, 3)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((3, 5, 3)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_141.py", line 9, in 260s assert (3, 3)==snapshot((3, 5, 3)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_142.py", line 9, in 260s assert (3, 3)==snapshot((3, 5, 3)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py:9: in 260s assert (3, 8)==snapshot((3, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 8)==snapshot((3, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____________________ test_generic [(3,) -> (3, 8, 8) ] ____________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py:9: in 260s assert (3, 8, 8)==snapshot((3,)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 8, 8)==snapshot((3,)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(3, 2+2) -> (3, 8, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py:9: in 260s assert (3, 8, 4)==snapshot((3, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 8, 4)==snapshot((3, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [(3, 3) -> (3, 8, 3) ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py:9: in 260s assert (3, 8, 3)==snapshot((3, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 8, 3)==snapshot((3, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(3, 2+2, 5) -> (3, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py:9: in 260s assert (3, 4)==snapshot((3, 2+2, 5)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 4)==snapshot((3, 2+2, 5)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(3, 2+2) -> (3, 4, 8) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py:9: in 260s assert (3, 4, 8)==snapshot((3, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 4, 8)==snapshot((3, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] ______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py:9: in 260s assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(3, 2+2, 3) -> (3, 4, 3) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py:9: in 260s assert (3, 4, 3)==snapshot((3, 2+2, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 4, 3)==snapshot((3, 2+2, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [(3, 3, 5) -> (3, 3) ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert (3, 3)==snapshot((3, 3, 5))' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_154.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((3, 3, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3, 3)==snapshot((3, 3, 5)) 260s source: assert (3, 3)==snapshot((3, 3, 5)) 260s set(): 260s assert (3, 3)==snapshot((3, 3, 5)) 260s assert (3, 3)==snapshot((3, 3, 5)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((3, 3, 5)) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert (3, 3)==snapshot((3, 3, 5)) 260s {'fix'}: 260s assert (3, 3)==snapshot((3, 3, 5)) 260s assert (3, 3)==snapshot((3, 3)) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3)==snapshot((3, 3, 5)) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_152.py", line 9, in 260s assert (3, 3)==snapshot((3, 3, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_153.py", line 9, in 260s assert (3, 3)==snapshot((3, 3, 5)) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________________ test_generic [(3, 3) -> (3, 3, 8) ] ___________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py:9: in 260s assert (3, 3, 8)==snapshot((3, 3)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 260s new_code = self.context.file._value_to_code(new_value_element) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '8 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3, 8)==snapshot((3, 3)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _______________ test_generic [(3, 3, 2+2) -> (3, 3, 4) ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py:9: in 260s assert (3, 3, 4)==snapshot((3, 3, 2+2)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 260s v = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert (3, 3, 4)==snapshot((3, 3, 2+2)) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ________________ test_generic [{0: 5, 1: 5, 2: 5} -> {} ] _________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {}==snapshot({0: 5, 1: 5, 2: 5})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_161.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s source: assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s set(): 260s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s {'fix'}: 260s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s assert {}==snapshot({}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_159.py", line 9, in 260s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_160.py", line 9, in 260s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________________ test_generic [{0: 5, 1: 5} -> {2: 8} ] __________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py:9: in 260s assert {2: 8}==snapshot({0: 5, 1: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {2: 8}==snapshot({0: 5, 1: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py:9: in 260s assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {2: 3}==snapshot({0: 5, 1: 5, 2: 3})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_166.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s source: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s set(): 260s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s {'fix'}: 260s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s assert {2: 3}==snapshot({2: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_164.py", line 9, in 260s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_165.py", line 9, in 260s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________________ test_generic [{0: 5, 2: 5} -> {1: 8} ] __________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py:9: in 260s assert {1: 8}==snapshot({0: 5, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 8}==snapshot({0: 5, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________________ test_generic [{0: 5} -> {1: 8, 2: 8} ] __________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py:9: in 260s assert {1: 8, 2: 8}==snapshot({0: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 8, 2: 8}==snapshot({0: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py:9: in 260s assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py:9: in 260s assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py:9: in 260s assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py:9: in 260s assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py:9: in 260s assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py:9: in 260s assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {1: 3}==snapshot({0: 5, 1: 3, 2: 5})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_177.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s source: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s set(): 260s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s {'fix'}: 260s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s assert {1: 3}==snapshot({1: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_175.py", line 9, in 260s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_176.py", line 9, in 260s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py:9: in 260s assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py:9: in 260s assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________ test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] ____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_182.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s source: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s set(): 260s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s {'fix'}: 260s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s assert {1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_180.py", line 9, in 260s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_181.py", line 9, in 260s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________________ test_generic [{1: 5, 2: 5} -> {0: 8} ] __________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py:9: in 260s assert {0: 8}==snapshot({1: 5, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8}==snapshot({1: 5, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________________ test_generic [{1: 5} -> {0: 8, 2: 8} ] __________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py:9: in 260s assert {0: 8, 2: 8}==snapshot({1: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 2: 8}==snapshot({1: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py:9: in 260s assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py:9: in 260s assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________________ test_generic [{2: 5} -> {0: 8, 1: 8} ] __________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py:9: in 260s assert {0: 8, 1: 8}==snapshot({2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 8}==snapshot({2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ________________ test_generic [{} -> {0: 8, 1: 8, 2: 8} ] _________________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py:9: in 260s assert {0: 8, 1: 8, 2: 8}==snapshot({}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 8, 2: 8}==snapshot({}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py:9: in 260s assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py:9: in 260s assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py:9: in 260s assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py:9: in 260s assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py:9: in 260s assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py:9: in 260s assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py:9: in 260s assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py:9: in 260s assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py:9: in 260s assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________ test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] ____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py:9: in 260s assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '0 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py:9: in 260s assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py:9: in 260s assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py:9: in 260s assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py:9: in 260s assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py:9: in 260s assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _________ test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] __________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py:9: in 260s assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py:9: in 260s assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py:9: in 260s assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py:9: in 260s assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py:9: in 260s assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ____ test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] ____ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py:9: in 260s assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] _____ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py:9: in 260s assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py:9: in 260s assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py:9: in 260s assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] _____ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py:9: in 260s assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py:9: in 260s assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {0: 3}==snapshot({0: 3, 1: 5, 2: 5})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_217.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s source: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s set(): 260s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s {'fix'}: 260s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s assert {0: 3}==snapshot({0: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_215.py", line 9, in 260s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_216.py", line 9, in 260s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py:9: in 260s assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py:9: in 260s assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________ test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] ____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_222.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s source: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s set(): 260s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s {'fix'}: 260s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s assert {0: 3, 2: 3}==snapshot({0: 3, 2: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_220.py", line 9, in 260s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_221.py", line 9, in 260s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py:9: in 260s assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______________ test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] _______________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py:9: in 260s assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py:9: in 260s assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________ test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] ____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py:9: in 260s assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py:9: in 260s assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] _______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py:9: in 260s assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s _____ test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] _____ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py:9: in 260s assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py:9: in 260s assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________ test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] ____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s s1 = source(code) 260s print("source:", code) 260s 260s assert set(s1.flags) == flags 260s 260s assert ("fix" in flags) == s1.error 260s 260s for f in all_flags: 260s c3 = build( 260s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 260s ) 260s new_code = f"assert {c2}==snapshot({c3})" 260s 260s print(f"{set(f)}:") 260s print(" ", code) 260s print(" ", new_code) 260s > s2 = s1.run(*f) 260s 260s tests/test_preserve_values.py:245: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:137: in run 260s recorder.fix_all() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\nPYTEST_DONT_REWRITE\n"""\n# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import external\nfrom inline_snapshot import outsource\n\nassert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5})' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_233.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s source: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s set(): 260s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s reported_flags: {'fix'} 260s run: pytest --inline-snapshot= 260s output: 260s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s {'fix'}: 260s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3}) 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_231.py", line 9, in 260s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s Traceback (most recent call last): 260s File "/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py", line 114, in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_232.py", line 9, in 260s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s AssertionError 260s ------------------------------ Captured log call ------------------------------- 260s 260s ___________ test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] ____________ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py:9: in 260s assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 260s self.context.file._value_to_code(k), 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 260s return self._token_to_code(value_to_token(value)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ______ test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] ______ 260s 260s source = .w at 0xeb301681d800> 260s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xeb301a8478c0>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 260s 260s def test_generic(source, subtests): 260s for braces in ("[]", "()", "{}"): 260s for value_specs in itertools.product(stuff, repeat=3): 260s flags = set().union(*[e[3] for e in value_specs]) 260s all_flags = { 260s frozenset(x) - {""} 260s for x in itertools.combinations_with_replacement( 260s flags | {""}, len(flags) 260s ) 260s } 260s 260s def build(value_lists): 260s value_lists = list(value_lists) 260s 260s if braces == "{}": 260s values = [ 260s f"{i}: {value_list[0]}" 260s for i, value_list in enumerate(value_lists) 260s if value_list 260s ] 260s else: 260s values = [x for value_list in value_lists for x in value_list] 260s 260s code = ", ".join(values) 260s 260s comma = "" 260s if len(values) == 1 and braces == "()": 260s comma = "," 260s 260s return f"{braces[0]}{code}{comma}{braces[1]}" 260s 260s c1 = build(spec[0] for spec in value_specs) 260s c2 = build(spec[1] for spec in value_specs) 260s code = f"assert {c2}==snapshot({c1})" 260s 260s named_flags = ", ".join(flags) 260s 260s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 260s > s1 = source(code) 260s 260s tests/test_preserve_values.py:229: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py:9: in 260s assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 260s result[key] = yield from self.get_adapter( 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 260s ------------------------------ Captured log call ------------------------------- 260s 260s ________________________ test_pydantic_create_snapshot _________________________ 260s 260s def test_pydantic_create_snapshot(): 260s 260s Example( 260s """ 260s from pydantic import BaseModel 260s from inline_snapshot import snapshot 260s 260s class M(BaseModel): 260s size:int 260s name:str 260s age:int=4 260s 260s def test_pydantic(): 260s m=M(size=5,name="Tom") 260s assert m==snapshot() 260s assert m.dict()==snapshot() 260s 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s 260s from pydantic import BaseModel 260s from inline_snapshot import snapshot 260s 260s class M(BaseModel): 260s size:int 260s name:str 260s age:int=4 260s 260s def test_pydantic(): 260s m=M(size=5,name="Tom") 260s assert m==snapshot(M(size=5, name="Tom")) 260s assert m.dict()==snapshot({"size": 5, "name": "Tom", "age": 4}) 260s 260s \ 260s """ 260s } 260s ), 260s ).run_pytest( 260s ["--inline-snapshot=disable"] 260s ) 260s 260s tests/test_pydantic.py:23: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_someth... 4})\n\n '} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': '\n' 260s E 'from pydantic import BaseModel\n' 260s E 'from inline_snapshot import snapshot\n' 260s E '\n' 260s E 'class M(BaseModel):\n'... 260s E 260s E ...Full output truncated (12 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s 260s from pydantic import BaseModel 260s from inline_snapshot import snapshot 260s 260s class M(BaseModel): 260s size:int 260s name:str 260s age:int=4 260s 260s def test_pydantic(): 260s m=M(size=5,name="Tom") 260s assert m==snapshot() 260s assert m.dict()==snapshot() 260s 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpd9kcd1vs 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_pydantic _________________________________ 260s 260s def test_pydantic(): 260s m=M(size=5,name="Tom") 260s > assert m==snapshot() 260s 260s test_something.py:12: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '', filename = PosixPath('/tmp/tmpd9kcd1vs/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 260s ============================== 1 failed in 0.30s =============================== 260s 260s stderr: 260s 260s ___________________________ test_pydantic_field_repr ___________________________ 260s 260s def test_pydantic_field_repr(): 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel,Field 260s 260s class container(BaseModel): 260s a: int 260s b: int = Field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel,Field 260s 260s class container(BaseModel): 260s a: int 260s b: int = Field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot(container(a=1)) 260s """ 260s } 260s ), 260s ).run_pytest( 260s ["--inline-snapshot=disable"] 260s ) 260s 260s tests/test_pydantic.py:64: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=create'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot\n' 260s E 'from pydantic import BaseModel,Field\n' 260s E '\n' 260s E 'class container(BaseModel):\n' 260s E ' a: int\n'... 260s E 260s E ...Full output truncated (4 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel,Field 260s 260s class container(BaseModel): 260s a: int 260s b: int = Field(default=5,repr=False) 260s 260s assert container(a=1,b=5) == snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp9eop5s50 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ______________________ ERROR collecting test_something.py ______________________ 260s test_something.py:8: in 260s assert container(a=1,b=5) == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.37s =============================== 260s 260s stderr: 260s 260s _________________________ test_pydantic_default_value __________________________ 260s 260s def test_pydantic_default_value(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s from pydantic import BaseModel,Field 260s 260s class A(BaseModel): 260s a:int 260s b:int=2 260s c:list=Field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=update"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s from pydantic import BaseModel,Field 260s 260s class A(BaseModel): 260s a:int 260s b:int=2 260s c:list=Field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1)) 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_pydantic.py:100: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=update'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_someth...ot(A(a=1))\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 260s E 'from dataclasses import dataclass,field\n' 260s E 'from pydantic import BaseModel,Field\n' 260s E '\n' 260s E 'class A(BaseModel):\n'... 260s E 260s E ...Full output truncated (7 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot,Is 260s from dataclasses import dataclass,field 260s from pydantic import BaseModel,Field 260s 260s class A(BaseModel): 260s a:int 260s b:int=2 260s c:list=Field(default_factory=list) 260s 260s def test_something(): 260s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpcgdnbr0b 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py . [100%] 260s =============================== inline snapshot ================================ 260s ─────────────────────────────── Update snapshots ─────────────────────────────── 260s 260s stderr: 260s Traceback (most recent call last): 260s File "", line 198, in _run_module_as_main 260s File "", line 88, in _run_code 260s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 260s raise SystemExit(pytest.console_main()) 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s ^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 260s diff = file.diff() 260s ^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 260s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 260s ^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s ^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s _________________________ test_pydantic_factory_method _________________________ 260s 260s def test_pydantic_factory_method(): 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel 260s 260s class A(BaseModel): 260s a:int 260s 260s @classmethod 260s def from_str(cls,s): 260s return cls(a=int(s)) 260s 260s def test_something(): 260s for a in [1,2]: 260s assert A(a=2) == snapshot(A.from_str("1")) 260s """ 260s > ).run_pytest( 260s ["--inline-snapshot=fix"], 260s changed_files=snapshot( 260s { 260s "test_something.py": """\ 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel 260s 260s class A(BaseModel): 260s a:int 260s 260s @classmethod 260s def from_str(cls,s): 260s return cls(a=int(s)) 260s 260s def test_something(): 260s for a in [1,2]: 260s assert A(a=2) == snapshot(A(a=2)) 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_pydantic.py:157: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--inline-snapshot=fix'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E AssertionError: assert {'test_someth...ot(A(a=2))\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'test_something.py': 'from inline_snapshot import snapshot\n' 260s E 'from pydantic import BaseModel\n' 260s E '\n' 260s E 'class A(BaseModel):\n' 260s E ' a:int\n'... 260s E 260s E ...Full output truncated (9 lines hidden), use '-vv' to show 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s from pydantic import BaseModel 260s 260s class A(BaseModel): 260s a:int 260s 260s @classmethod 260s def from_str(cls,s): 260s return cls(a=int(s)) 260s 260s def test_something(): 260s for a in [1,2]: 260s assert A(a=2) == snapshot(A.from_str("1")) 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp2oz4m04b 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s for a in [1,2]: 260s > assert A(a=2) == snapshot(A.from_str("1")) 260s 260s test_something.py:13: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 260s result = yield from self.value_assign(old_value, old_node, new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 260s result = yield from adapter.assign(old_value, old_node, new_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = 'A (a =2 )', filename = PosixPath('/tmp/tmp2oz4m04b/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 260s ============================== 1 failed in 0.30s =============================== 260s 260s stderr: 260s 260s __________________________________ test_pypy ___________________________________ 260s 260s @pytest.mark.no_rewriting 260s def test_pypy(): 260s report = ( 260s snapshot("INFO: inline-snapshot was disabled because pypy is not supported") 260s if sys.implementation.name == "pypy" 260s else snapshot( 260s """\ 260s -------------------------------- Fix snapshots --------------------------------- 260s +----------------------------- test_something.py ------------------------------+ 260s | @@ -1,6 +1,6 @@ | 260s | | 260s | from inline_snapshot import snapshot | 260s | | 260s | def test_example(): | 260s | - assert 1+1==snapshot(3) | 260s | + assert 1+1==snapshot(2) | 260s +------------------------------------------------------------------------------+ 260s These changes will be applied, because you used --inline-snapshot=fix\ 260s """ 260s ) 260s ) 260s 260s Example( 260s """\ 260s from inline_snapshot import snapshot 260s 260s def test_example(): 260s assert 1+1==snapshot(3) 260s 260s """ 260s > ).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( 260s ["--inline-snapshot=disable"], report="" 260s ) 260s 260s tests/test_pypy.py:38: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 260s assert normalize(report_str) == report, repr(report_str) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "''" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pypy.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_something.py 260s from inline_snapshot import snapshot 260s 260s def test_example(): 260s assert 1+1==snapshot(3) 260s 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp58idz315 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s _________________________________ test_example _________________________________ 260s 260s def test_example(): 260s > assert 1+1==snapshot(3) 260s 260s test_something.py:4: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ', filename = PosixPath('/tmp/tmp58idz315/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_something.py::test_example - TypeError: CliRunner.__init__() got ... 260s ============================== 1 failed in 0.23s =============================== 260s 260s stderr: 260s 260s _________________________________ test_create __________________________________ 260s 260s project = .Project object at 0xeb30161aa270> 260s 260s def test_create(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert 5==snapshot() 260s """ 260s ) 260s 260s result = project.run() 260s 260s > result.assert_outcomes(errors=1, passed=1) 260s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 260s E 260s E Omitting 4 identical items, use -vv to show 260s E Differing items: 260s E {'passed': 0} != {'passed': 1} 260s E {'failed': 1} != {'failed': 0} 260s E Use -v to get more diff 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:24: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert 5==snapshot() 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_create0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_create0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py FE [100%] 260s 260s ==================================== ERRORS ==================================== 260s _________________________ ERROR at teardown of test_a __________________________ 260s your snapshot is missing one value. 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 5==snapshot() 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_create0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 260s ========================== 1 failed, 1 error in 0.31s ========================== 260s ___________________________________ test_fix ___________________________________ 260s 260s project = .Project object at 0xeb3015d40dd0> 260s 260s def test_fix(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert 5==snapshot(4) 260s """ 260s ) 260s 260s result = project.run() 260s 260s > result.assert_outcomes(failed=1, errors=1) 260s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 260s E 260s E Omitting 5 identical items, use -vv to show 260s E Differing items: 260s E {'errors': 0} != {'errors': 1} 260s E Use -v to get more diff 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:71: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert 5==snapshot(4) 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 5==snapshot(4) 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '5 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.31s =============================== 260s _________________________________ test_update __________________________________ 260s 260s project = .Project object at 0xeb3015d40860> 260s 260s def test_update(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert "5" == snapshot('''5''') 260s """ 260s ) 260s 260s result = project.run() 260s 260s > result.assert_outcomes(passed=1) 260s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 260s E 260s E Omitting 4 identical items, use -vv to show 260s E Differing items: 260s E {'passed': 0} != {'passed': 1} 260s E {'failed': 1} != {'failed': 0} 260s E Use -v to get more diff 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:118: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert "5" == snapshot('''5''') 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_update0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_update0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert "5" == snapshot('''5''') 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'5'" 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_update0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.31s =============================== 260s __________________________________ test_trim ___________________________________ 260s 260s project = .Project object at 0xeb3015d42e70> 260s 260s def test_trim(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert 5 in snapshot([4,5]) 260s """ 260s ) 260s 260s result = project.run() 260s 260s result.assert_outcomes(passed=1) 260s 260s assert result.report == snapshot( 260s """\ 260s Info: one snapshot can be trimmed (--inline-snapshot=trim) 260s You can also use --inline-snapshot=review to approve the changes interactively 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=trim") 260s 260s > assert result.report == snapshot( 260s """\ 260s -------------------------------- Trim snapshots -------------------------------- 260s +-------------------------------- test_file.py --------------------------------+ 260s | @@ -4,4 +4,4 @@ | 260s | | 260s | | 260s | | 260s | def test_a(): | 260s | - assert 5 in snapshot([4,5]) | 260s | + assert 5 in snapshot([5]) | 260s +------------------------------------------------------------------------------+ 260s These changes will be applied, because you used --inline-snapshot=trim 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:178: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'-------------------------------- Trim snapshots --------------------------------'" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert 5 in snapshot([4,5]) 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py . [100%] 260s =============================== inline snapshot ================================ 260s Info: one snapshot can be trimmed (--inline-snapshot=trim) 260s 260s You can also use --inline-snapshot=review to approve the changes interactively 260s 260s ============================== 1 passed in 0.21s =============================== 260s running: pytest --inline-snapshot=trim 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py . [100%] 260s =============================== inline snapshot ================================ 260s ──────────────────────────────── Trim snapshots ──────────────────────────────── 260s ----------------------------- Captured stderr call ----------------------------- 260s Traceback (most recent call last): 260s File "/usr/bin/pytest", line 8, in 260s sys.exit(console_main()) 260s ~~~~~~~~~~~~^^ 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 260s code = main() 260s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 260s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 260s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 260s return wrap_session(config, _main) 260s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 260s config.hook.pytest_sessionfinish( 260s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 260s session=session, exitstatus=session.exitstatus 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s ) 260s ^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ~~~~~~~~~~~~~~^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 260s teardown.send(result) # type: ignore[union-attr] 260s ~~~~~~~~~~~~~^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 260s self.config.hook.pytest_terminal_summary( 260s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 260s terminalreporter=self, exitstatus=exitstatus, config=self.config 260s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s ) 260s ^ 260s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 260s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 260s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 260s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 260s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 260s raise exception.with_traceback(exception.__traceback__) 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ~~~~~~~~~~~~~~^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 260s teardown.throw(exception) # type: ignore[union-attr] 260s ~~~~~~~~~~~~~~^^^^^^^^^^^ 260s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 260s return (yield) 260s ^^^^^ 260s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 260s res = hook_impl.function(*args) 260s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 260s diff = file.diff() 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 260s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 260s ~~~~~~~~~~~~~^^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s ~~~~~~~~~~~^ 260s code, self.filename 260s ^^^^^^^^^^^^^^^^^^^ 260s ) 260s ^ 260s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 260s runner = CliRunner(mix_stderr=False) 260s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s ________________________________ test_multiple _________________________________ 260s 260s project = .Project object at 0xeb3015d426c0> 260s 260s def test_multiple(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert "5" == snapshot('''5''') 260s assert 5 <= snapshot(8) 260s assert 5 == snapshot(4) 260s """ 260s ) 260s 260s result = project.run() 260s 260s > result.assert_outcomes(failed=1, errors=1) 260s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 260s E 260s E Omitting 5 identical items, use -vv to show 260s E Differing items: 260s E {'errors': 0} != {'errors': 1} 260s E Use -v to get more diff 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:214: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert "5" == snapshot('''5''') 260s assert 5 <= snapshot(8) 260s assert 5 == snapshot(4) 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert "5" == snapshot('''5''') 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'5'" 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.31s =============================== 260s _____________________________ test_multiple_report _____________________________ 260s 260s project = .Project object at 0xeb3015badf40> 260s 260s def test_multiple_report(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert "5" == snapshot('''5''') 260s assert 5 <= snapshot(8) 260s assert 5 == snapshot(4) 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=trim,report") 260s 260s > assert result.report == snapshot( 260s """\ 260s -------------------------------- Fix snapshots --------------------------------- 260s +-------------------------------- test_file.py --------------------------------+ 260s | @@ -6,4 +6,4 @@ | 260s | | 260s | def test_a(): | 260s | assert "5" == snapshot('''5''') | 260s | assert 5 <= snapshot(8) | 260s | - assert 5 == snapshot(4) | 260s | + assert 5 == snapshot(5) | 260s +------------------------------------------------------------------------------+ 260s These changes are not applied. 260s Use --inline-snapshot=fix to apply them, or use the interactive mode with 260s --inline-snapshot=review 260s -------------------------------- Trim snapshots -------------------------------- 260s +-------------------------------- test_file.py --------------------------------+ 260s | @@ -5,5 +5,5 @@ | 260s | | 260s | | 260s | def test_a(): | 260s | assert "5" == snapshot('''5''') | 260s | - assert 5 <= snapshot(8) | 260s | + assert 5 <= snapshot(5) | 260s | assert 5 == snapshot(4) | 260s +------------------------------------------------------------------------------+ 260s These changes will be applied, because you used --inline-snapshot=trim 260s ------------------------------- Update snapshots ------------------------------- 260s +-------------------------------- test_file.py --------------------------------+ 260s | @@ -4,6 +4,6 @@ | 260s | | 260s | | 260s | | 260s | def test_a(): | 260s | - assert "5" == snapshot('''5''') | 260s | + assert "5" == snapshot("5") | 260s | assert 5 <= snapshot(5) | 260s | assert 5 == snapshot(4) | 260s +------------------------------------------------------------------------------+ 260s These changes are not applied. 260s Use --inline-snapshot=update to apply them, or use the interactive mode with 260s --inline-snapshot=review 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:307: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "''" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert "5" == snapshot('''5''') 260s assert 5 <= snapshot(8) 260s assert 5 == snapshot(4) 260s 260s running: pytest --inline-snapshot=trim,report 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert "5" == snapshot('''5''') 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'5'" 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.30s =============================== 260s ______________________________ test_black_config _______________________________ 260s 260s project = .Project object at 0xeb3015bae8a0> 260s 260s def test_black_config(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert list(range(10)) == snapshot([]) 260s """ 260s ) 260s 260s > project.format() 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:370: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/conftest.py:315: in format 260s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\n\n\ndef test_a():\n assert list(range(10)) == snapshot([])\n' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_black_config0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert list(range(10)) == snapshot([]) 260s 260s ________________________________ test_disabled _________________________________ 260s 260s project = .Project object at 0xeb3015bafad0> 260s 260s def test_disabled(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert 4==snapshot(5) 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=disable") 260s result.assert_outcomes(failed=1) 260s 260s result = project.run("--inline-snapshot=fix") 260s > assert project.source == snapshot( 260s """\ 260s def test_a(): 260s assert 4==snapshot(4) 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:409: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\ndef test_a():\n assert 4==snapshot(5)\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert 4==snapshot(5) 260s 260s running: pytest --inline-snapshot=disable 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 4==snapshot(5) 260s E assert 4 == 5 260s E + where 5 = snapshot(5) 260s 260s test_file.py:7: AssertionError 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - assert 4 == 5 260s ============================== 1 failed in 0.20s =============================== 260s running: pytest --inline-snapshot=fix 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 4==snapshot(5) 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '4 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_disabled0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.29s =============================== 260s _________________________________ test_compare _________________________________ 260s 260s project = .Project object at 0xeb3015bad6d0> 260s 260s def test_compare(project): 260s project.setup( 260s """\ 260s def test_a(): 260s assert "a"==snapshot("b") 260s """ 260s ) 260s 260s result = project.run() 260s > assert result.errorLines() == snapshot( 260s """\ 260s > assert "a"==snapshot("b") 260s E AssertionError: assert 'a' == 'b' 260s E ⏎ 260s E - b 260s E + a 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:429: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\n> assert "a"==snapshot("b")\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_a(): 260s assert "a"==snapshot("b") 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert "a"==snapshot("b") 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "'a'" 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_compare0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 260s ============================== 1 failed in 0.31s =============================== 260s __________________________ test_assertion_error_loop ___________________________ 260s 260s project = .Project object at 0xeb3015d41700> 260s 260s def test_assertion_error_loop(project): 260s project.setup( 260s """\ 260s for e in (1, 2): 260s assert e == snapshot() 260s """ 260s ) 260s result = project.run() 260s > assert result.errorLines() == snapshot( 260s """\ 260s E assert 2 == 1 260s E + where 1 = snapshot() 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:466: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s for e in (1, 2): 260s assert e == snapshot() 260s 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ________________________ ERROR collecting test_file.py _________________________ 260s test_file.py:7: in 260s assert e == snapshot() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.28s =============================== 260s _____________________________ test_assertion_error _____________________________ 260s 260s project = .Project object at 0xeb3015bd4ad0> 260s 260s def test_assertion_error(project): 260s project.setup("assert 2 == snapshot(1)") 260s result = project.run() 260s > assert result.errorLines() == snapshot( 260s """\ 260s E assert 2 == 1 260s E + where 1 = snapshot(1) 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:493: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s assert 2 == snapshot(1) 260s running: pytest 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 0 items / 1 error 260s 260s ==================================== ERRORS ==================================== 260s ________________________ ERROR collecting test_file.py _________________________ 260s test_file.py:6: in 260s assert 2 == snapshot(1) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 260s runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 260s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 260s =============================== 1 error in 0.28s =============================== 260s _______________________ test_pytest_inlinesnapshot_auto ________________________ 260s 260s project = .Project object at 0xeb3015bd6270> 260s 260s def test_pytest_inlinesnapshot_auto(project): 260s project.setup( 260s """\ 260s def test_something(): 260s assert 2 == snapshot(1) 260s """ 260s ) 260s result = project.run("--inline-snapshot=review", stdin=b"y\n") 260s > assert result.errorLines() == snapshot("") 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:526: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\n> assert 2 == snapshot(1)\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s def test_something(): 260s assert 2 == snapshot(1) 260s 260s running: pytest --inline-snapshot=review 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s > assert 2 == snapshot(1) 260s 260s test_file.py:7: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '2 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 260s ============================== 1 failed in 0.30s =============================== 260s ________________________ test_persist_unknown_external _________________________ 260s 260s project = .Project object at 0xeb3015ad3b60> 260s 260s def test_persist_unknown_external(project): 260s project.setup( 260s """\ 260s from inline_snapshot import external, snapshot 260s 260s def test_sub_snapshot(): 260s external("123*.png") 260s assert 1==snapshot(2) 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=fix") 260s 260s > assert project.source == snapshot( 260s """\ 260s from inline_snapshot import external, snapshot 260s 260s def test_sub_snapshot(): 260s external("123*.png") 260s assert 1==snapshot(1) 260s """ 260s ) 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:596: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nfrom inline_snapshot import external, snapshot\n\ndef test_sub_snapshot():\n external("123*.png")\n assert 1==snapshot(2)\n"""' 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s from inline_snapshot import external, snapshot 260s 260s def test_sub_snapshot(): 260s external("123*.png") 260s assert 1==snapshot(2) 260s 260s running: pytest --inline-snapshot=fix 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ______________________________ test_sub_snapshot _______________________________ 260s 260s def test_sub_snapshot(): 260s external("123*.png") 260s > assert 1==snapshot(2) 260s 260s test_file.py:8: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_sub_snapshot - TypeError: CliRunner.__init__() got ... 260s ============================== 1 failed in 0.30s =============================== 260s ___________________________ test_diff_multiple_files ___________________________ 260s 260s def test_diff_multiple_files(): 260s 260s Example( 260s { 260s "test_a.py": """ 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s """, 260s "test_b.py": """ 260s from inline_snapshot import snapshot 260s 260s def test_b(): 260s assert 1==snapshot() 260s """, 260s } 260s > ).run_pytest( 260s ["--inline-snapshot=create,fix"], 260s changed_files=snapshot( 260s { 260s "test_b.py": """\ 260s 260s from inline_snapshot import snapshot 260s 260s def test_b(): 260s assert 1==snapshot(1) 260s \ 260s """, 260s "test_a.py": """\ 260s 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(1) 260s \ 260s """, 260s } 260s ), 260s report=snapshot( 260s """\ 260s ------------------------------- Create snapshots ------------------------------- 260s +--------------------------------- test_b.py ----------------------------------+ 260s | @@ -2,5 +2,5 @@ | 260s | | 260s | from inline_snapshot import snapshot | 260s | | 260s | def test_b(): | 260s | - assert 1==snapshot() | 260s | + assert 1==snapshot(1) | 260s +------------------------------------------------------------------------------+ 260s These changes will be applied, because you used --inline-snapshot=create 260s -------------------------------- Fix snapshots --------------------------------- 260s +--------------------------------- test_a.py ----------------------------------+ 260s | @@ -2,5 +2,5 @@ | 260s | | 260s | from inline_snapshot import snapshot | 260s | | 260s | def test_a(): | 260s | - assert 1==snapshot(2) | 260s | + assert 1==snapshot(1) | 260s +------------------------------------------------------------------------------+ 260s These changes will be applied, because you used --inline-snapshot=fix\ 260s """ 260s ), 260s ) 260s 260s tests/test_pytest_plugin.py:626: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 260s assert normalize(report_str) == report, repr(report_str) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = "''" 260s filename = PosixPath('/tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: test_a.py 260s 260s from inline_snapshot import snapshot 260s 260s def test_a(): 260s assert 1==snapshot(2) 260s 260s 260s file: test_b.py 260s 260s from inline_snapshot import snapshot 260s 260s def test_b(): 260s assert 1==snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmp9okemqmk 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 2 items 260s 260s test_a.py F [ 50%] 260s test_b.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ____________________________________ test_a ____________________________________ 260s 260s def test_a(): 260s > assert 1==snapshot(2) 260s 260s test_a.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '1 ', filename = PosixPath('/tmp/tmp9okemqmk/test_a.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ____________________________________ test_b ____________________________________ 260s 260s def test_b(): 260s > assert 1==snapshot() 260s 260s test_b.py:5: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '', filename = PosixPath('/tmp/tmp9okemqmk/test_b.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 260s FAILED test_b.py::test_b - TypeError: CliRunner.__init__() got an unexpected ... 260s ============================== 2 failed in 0.26s =============================== 260s 260s stderr: 260s 260s ___________________ test_storage_dir_config[tests/snapshots] ___________________ 260s 260s project = .Project object at 0xeb3015af5a60> 260s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_tests_0') 260s storage_dir = 'tests/snapshots' 260s 260s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 260s def test_storage_dir_config(project, tmp_path, storage_dir): 260s # Relative path case: `tests/snapshots` (parametrized). 260s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 260s if not storage_dir: 260s storage_dir = tmp_path / "snapshots" 260s 260s project.pyproject( 260s f""" 260s [tool.inline-snapshot] 260s storage-dir = "{storage_dir}" 260s """ 260s ) 260s 260s project.setup( 260s """ 260s from inline_snapshot import outsource, snapshot 260s 260s def test_outsource(): 260s assert outsource("hello", suffix=".html") == snapshot() 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=create") 260s > assert result.ret == 0 260s E assert == 0 260s E + where = .ret 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s 260s from inline_snapshot import outsource, snapshot 260s 260s def test_outsource(): 260s assert outsource("hello", suffix=".html") == snapshot() 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_outsource ________________________________ 260s 260s def test_outsource(): 260s > assert outsource("hello", suffix=".html") == snapshot() 260s 260s test_file.py:10: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 260s ============================== 1 failed in 0.29s =============================== 260s ________________________ test_storage_dir_config[None] _________________________ 260s 260s project = .Project object at 0xeb3015af6480> 260s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0') 260s storage_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0/snapshots') 260s 260s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 260s def test_storage_dir_config(project, tmp_path, storage_dir): 260s # Relative path case: `tests/snapshots` (parametrized). 260s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 260s if not storage_dir: 260s storage_dir = tmp_path / "snapshots" 260s 260s project.pyproject( 260s f""" 260s [tool.inline-snapshot] 260s storage-dir = "{storage_dir}" 260s """ 260s ) 260s 260s project.setup( 260s """ 260s from inline_snapshot import outsource, snapshot 260s 260s def test_outsource(): 260s assert outsource("hello", suffix=".html") == snapshot() 260s """ 260s ) 260s 260s result = project.run("--inline-snapshot=create") 260s > assert result.ret == 0 260s E assert == 0 260s E + where = .ret 260s 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s write code: 260s # äöß 🐍 260s from inline_snapshot import snapshot 260s from inline_snapshot import outsource 260s 260s 260s 260s from inline_snapshot import outsource, snapshot 260s 260s def test_outsource(): 260s assert outsource("hello", suffix=".html") == snapshot() 260s 260s running: pytest --inline-snapshot=create 260s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 260s ============================= test session starts ============================== 260s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 260s configfile: pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s test_file.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_outsource ________________________________ 260s 260s def test_outsource(): 260s > assert outsource("hello", suffix=".html") == snapshot() 260s 260s test_file.py:10: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1/test_file.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 260s ============================== 1 failed in 0.29s =============================== 260s __________________ test_find_pyproject_in_parent_directories ___________________ 260s 260s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_find_pyproject_in_parent_0') 260s 260s def test_find_pyproject_in_parent_directories(tmp_path): 260s 260s Example( 260s { 260s "pyproject.toml": """\ 260s [tool.inline-snapshot] 260s hash-length=2 260s """, 260s "project/pytest.ini": "", 260s "project/test_something.py": """\ 260s from inline_snapshot import outsource,snapshot,external 260s 260s def test_something(): 260s assert outsource("test") == snapshot() 260s """, 260s } 260s > ).run_pytest( 260s ["--rootdir", "./project", "--inline-snapshot=create"], 260s changed_files=snapshot( 260s { 260s "project/test_something.py": """\ 260s from inline_snapshot import outsource,snapshot,external 260s 260s def test_something(): 260s assert outsource("test") == snapshot(external("9f*.txt")) 260s """ 260s } 260s ), 260s ) 260s 260s tests/test_pytest_plugin.py:790: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s self = 260s args = ['--rootdir', './project', '--inline-snapshot=create'] 260s 260s def run_pytest( 260s self, 260s args: list[str] = [], 260s *, 260s term_columns=80, 260s env: dict[str, str] = {}, 260s changed_files: Snapshot[dict[str, str]] | None = None, 260s report: Snapshot[str] | None = None, 260s stderr: Snapshot[str] | None = None, 260s returncode: Snapshot[int] | None = None, 260s ) -> Example: 260s """Run pytest with the given args and env variables in an seperate 260s process. 260s 260s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 260s 260s Parameters: 260s args: pytest arguments like "--inline-snapshot=fix" 260s env: dict of environment variables 260s changed_files: snapshot of files which are changed by this run. 260s report: snapshot of the report at the end of the pytest run. 260s stderr: pytest stderr output 260s returncode: snapshot of the pytest returncode. 260s 260s Returns: 260s A new Example instance which contains the changed files. 260s """ 260s 260s with TemporaryDirectory() as dir: 260s tmp_path = Path(dir) 260s self._write_files(tmp_path) 260s 260s cmd = [sys.executable, "-m", "pytest", *args] 260s 260s command_env = dict(os.environ) 260s command_env["TERM"] = "unknown" 260s command_env["COLUMNS"] = str( 260s term_columns + 1 if platform.system() == "Windows" else term_columns 260s ) 260s command_env.pop("CI", None) 260s 260s command_env.update(env) 260s 260s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 260s 260s print("run>", *cmd) 260s print("stdout:") 260s print(result.stdout.decode()) 260s print("stderr:") 260s print(result.stderr.decode()) 260s 260s if returncode is not None: 260s assert result.returncode == returncode 260s 260s if stderr is not None: 260s assert result.stderr.decode() == stderr 260s 260s if report is not None: 260s 260s report_list = [] 260s record = False 260s for line in result.stdout.decode().splitlines(): 260s line = line.strip() 260s if line.startswith("===="): 260s record = False 260s 260s if record and line: 260s report_list.append(line) 260s 260s if line.startswith("====") and "inline snapshot" in line: 260s record = True 260s 260s report_str = "\n".join(report_list) 260s 260s assert normalize(report_str) == report, repr(report_str) 260s 260s if changed_files is not None: 260s current_files = {} 260s 260s for name, content in sorted(self._read_files(tmp_path).items()): 260s if name not in self.files or self.files[name] != content: 260s current_files[name] = content 260s > assert changed_files == current_files 260s E assert {'project/tes...9f*.txt"))\n'} == {} 260s E 260s E Left contains 1 more item: 260s E {'project/test_something.py': 'from inline_snapshot import ' 260s E 'outsource,snapshot,external\n' 260s E '\n' 260s E 'def test_something():\n' 260s E ' assert outsource("test") == ' 260s E 'snapshot(external("9f*.txt"))\n'} 260s E Use -v to get more diff 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 260s ----------------------------- Captured stdout call ----------------------------- 260s file: pyproject.toml 260s [tool.inline-snapshot] 260s hash-length=2 260s 260s 260s file: project/pytest.ini 260s 260s 260s file: project/test_something.py 260s from inline_snapshot import outsource,snapshot,external 260s 260s def test_something(): 260s assert outsource("test") == snapshot() 260s 260s 260s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 260s stdout: 260s ============================= test session starts ============================== 260s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 260s rootdir: /tmp/tmpiz6b7v9e/project 260s configfile: ../pyproject.toml 260s plugins: mock-3.14.0, pytest_freezer-0.4.9, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, subtests-0.13.1, typeguard-4.4.1 260s collected 1 item 260s 260s project/test_something.py F [100%] 260s 260s =================================== FAILURES =================================== 260s ________________________________ test_something ________________________________ 260s 260s def test_something(): 260s > assert outsource("test") == snapshot() 260s 260s project/test_something.py:4: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '', filename = PosixPath('/tmp/tmpiz6b7v9e/project/test_something.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s =============================== inline snapshot ================================ 260s =========================== short test summary info ============================ 260s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 260s ============================== 1 failed in 0.25s =============================== 260s 260s stderr: 260s 260s _________________________________ test_rewrite _________________________________ 260s 260s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0') 260s 260s def test_rewrite(tmp_path): 260s file = tmp_path / "file.txt" 260s file.write_text( 260s """ 260s 12345 260s 12345 260s 12345 260s """, 260s "utf-8", 260s ) 260s 260s with ChangeRecorder().activate() as recorder: 260s s = recorder.change_set() 260s 260s s.replace(((2, 2), (2, 3)), "a", filename=file) 260s s.delete(((3, 2), (3, 3)), filename=file) 260s s.insert((4, 2), "c", filename=file) 260s 260s assert recorder.num_fixes() == 1 260s > recorder.fix_all() 260s 260s tests/test_rewrite_code.py:43: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 260s file.rewrite() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 260s new_code = self.new_code() 260s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 260s format_whole_file = enforce_formatting() or code == format_code( 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '\n12345\n12345\n12345\n' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0/file.txt') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ______________________________ test_string_update ______________________________ 260s 260s check_update = .w at 0xeb3015a5e700> 260s 260s def test_string_update(check_update): 260s # black --preview wraps strings to keep the line length. 260s # string concatenation should produce updates. 260s assert ( 260s check_update( 260s 'assert "ab" == snapshot("a" "b")', reported_flags="", flags="update" 260s ) 260s == 'assert "ab" == snapshot("a" "b")' 260s ) 260s 260s assert ( 260s check_update( 260s 'assert "ab" == snapshot("a"\n "b")', reported_flags="", flags="update" 260s ) 260s == 'assert "ab" == snapshot("a"\n "b")' 260s ) 260s 260s > assert check_update( 260s 'assert "ab\\nc" == snapshot("a"\n "b\\nc")', flags="update" 260s ) == snapshot( 260s '''\ 260s assert "ab\\nc" == snapshot("""\\ 260s ab 260s c\\ 260s """)\ 260s ''' 260s ) 260s 260s tests/test_string.py:26: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:114: in run 260s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 260s /tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py:9: in 260s assert "ab\nc" == snapshot("a" 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 260s return self == other 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 260s self._changes.append(next(it)) 260s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 260s new_code = self.context.file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\nab\nc\\\n"""' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert "ab" == snapshot("a" "b") 260s reported_flags: set() 260s run: pytest --inline-snapshot= 260s output: 260s |assert "ab" == snapshot("a" "b") 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert "ab" == snapshot("a" "b") 260s reported_flags: set() 260s run: pytest --inline-snapshot=update 260s output: 260s |assert "ab" == snapshot("a" "b") 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert "ab" == snapshot("a" 260s | "b") 260s reported_flags: set() 260s run: pytest --inline-snapshot= 260s output: 260s |assert "ab" == snapshot("a" 260s | "b") 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert "ab" == snapshot("a" 260s | "b") 260s reported_flags: set() 260s run: pytest --inline-snapshot=update 260s output: 260s |assert "ab" == snapshot("a" 260s | "b") 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |assert "ab\nc" == snapshot("a" 260s | "b\nc") 260s _____________________________ test_string_newline ______________________________ 260s 260s check_update = .w at 0xeb3015a4aa20> 260s 260s def test_string_newline(check_update): 260s > assert check_update('s = snapshot("a\\nb")', flags="update") == snapshot( 260s '''\ 260s s = snapshot("""\\ 260s a 260s b\\ 260s """)\ 260s ''' 260s ) 260s 260s tests/test_string.py:46: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 260s yield from handle(self._ast_node, self._old_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\na\nb\\\n"""' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_newline0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot("a\nb") 260s ___________________________ test_string_quote_choice ___________________________ 260s 260s check_update = .w at 0xeb3015a5e980> 260s 260s def test_string_quote_choice(check_update): 260s > assert check_update( 260s "s = snapshot(\" \\'\\'\\' \\'\\'\\' \\\"\\\"\\\"\\nother_line\")", 260s flags="update", 260s ) == snapshot( 260s '''\ 260s s = snapshot("""\\ 260s \'\'\' \'\'\' \\"\\"\\" 260s other_line\\ 260s """)\ 260s ''' 260s ) 260s 260s tests/test_string.py:115: 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s tests/conftest.py:49: in w 260s s = source(source_code) 260s tests/conftest.py:158: in w 260s return Source(source=source).run() 260s tests/conftest.py:125: in run 260s changes += snapshot._changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 260s yield from self._value._get_changes() 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 260s yield from handle(self._ast_node, self._old_value) 260s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 260s new_code = self._file._token_to_code(new_token) 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 260s return self._format(tokenize.untokenize(tokens)).strip() 260s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 260s return format_code(text, Path(self._source.filename)) 260s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 260s 260s text = '"""\\\n \'\'\' \'\'\' \\"\\"\\"\nother_line\\\n"""' 260s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_quote_choice0/test_1.py') 260s 260s def format_code(text, filename): 260s if _config.config.format_command is not None: 260s format_command = _config.config.format_command.format(filename=filename) 260s result = sp.run( 260s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 260s ) 260s if result.returncode != 0: 260s raise_problem( 260s f"""\ 260s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 260s """ 260s + result.stdout.decode("utf-8") 260s + result.stderr.decode("utf-8") 260s ) 260s return text 260s return result.stdout.decode("utf-8") 260s 260s try: 260s from black import main 260s from click.testing import CliRunner 260s except ImportError: 260s raise_problem( 260s f"""\ 260s [b]inline-snapshot is not able to format your code.[/b] 260s This issue can be solved by: 260s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 260s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 260s """ 260s ) 260s return text 260s 260s with warnings.catch_warnings(): 260s warnings.simplefilter("ignore") 260s 260s > runner = CliRunner(mix_stderr=False) 260s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 260s 260s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 260s ----------------------------- Captured stdout call ----------------------------- 260s 260s input: 260s |""" 260s |PYTEST_DONT_REWRITE 260s |""" 260s |# äöß 🐍 260s |from inline_snapshot import snapshot 260s |from inline_snapshot import external 260s |from inline_snapshot import outsource 260s | 260s |s = snapshot(" \'\'\' \'\'\' \"\"\"\nother_line") 260s =============================== warnings summary =============================== 260s tests/adapter/test_sequence.py:64 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/adapter/test_sequence.py:64: PytestUnknownMarkWarning: Unknown pytest.mark.no_rewriting - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html 260s @pytest.mark.no_rewriting 260s 260s tests/test_inline_snapshot.py:17 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_inline_snapshot.py:17: PytestUnknownMarkWarning: Unknown pytest.mark.no_rewriting - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html 260s @pytest.mark.no_rewriting 260s 260s tests/test_inline_snapshot.py:24 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_inline_snapshot.py:24: PytestUnknownMarkWarning: Unknown pytest.mark.no_rewriting - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html 260s @pytest.mark.no_rewriting 260s 260s tests/test_pypy.py:8 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pypy.py:8: PytestUnknownMarkWarning: Unknown pytest.mark.no_rewriting - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html 260s @pytest.mark.no_rewriting 260s 260s tests/test_pytest_plugin.py:275 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:275: PytestUnknownMarkWarning: Unknown pytest.mark.no_rewriting - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html 260s @pytest.mark.no_rewriting 260s 260s tests/test_pytest_plugin.py:501 260s /tmp/autopkgtest.2UZR8n/autopkgtest_tmp/tests/test_pytest_plugin.py:501: PytestUnknownMarkWarning: Unknown pytest.mark.no_rewriting - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html 260s @pytest.mark.no_rewriting 260s 260s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 260s =============================== inline snapshot ================================ 260s Error: one snapshot has incorrect values (--inline-snapshot=fix) 260s 260s You can also use --inline-snapshot=review to approve the changes interactively 260s =========================== short test summary info ============================ 260s FAILED tests/adapter/test_dataclass.py::test_unmanaged - TypeError: CliRunner... 260s FAILED tests/adapter/test_dataclass.py::test_reeval - assert None == ('TypeEr... 260s FAILED tests/adapter/test_dataclass.py::test_dataclass_default_value - TypeEr... 260s FAILED tests/adapter/test_dataclass.py::test_attrs_default_value - AssertionE... 260s FAILED tests/adapter/test_dataclass.py::test_attrs_field_repr - AssertionErro... 260s FAILED tests/adapter/test_dataclass.py::test_disabled[executing] - TypeError:... 260s FAILED tests/adapter/test_dataclass.py::test_disabled[without-executing] - At... 260s FAILED tests/adapter/test_dataclass.py::test_add_argument - TypeError: CliRun... 260s FAILED tests/adapter/test_dataclass.py::test_remove_positional_argument - ass... 260s FAILED tests/adapter/test_dataclass.py::test_namedtuple - assert {'test_somet... 260s FAILED tests/adapter/test_dataclass.py::test_defaultdict - assert {'test_some... 260s FAILED tests/adapter/test_dataclass.py::test_dataclass_field_repr - assert No... 260s FAILED tests/adapter/test_dataclass.py::test_dataclass_var - assert None == (... 260s FAILED tests/adapter/test_dict.py::test_dict_var - assert None == ('TypeError... 260s FAILED tests/adapter/test_general.py::test_adapter_mismatch - assert None == ... 260s FAILED tests/adapter/test_sequence.py::test_list_adapter_create_inner_snapshot 260s FAILED tests/adapter/test_sequence.py::test_list_adapter_fix_inner_snapshot 260s FAILED tests/adapter/test_sequence.py::test_list_var - assert None == ('TypeE... 260s FAILED tests/test_change.py::test_change_function_args - TypeError: CliRunner... 260s FAILED tests/test_code_repr.py::test_enum - TypeError: CliRunner.__init__() g... 260s FAILED tests/test_code_repr.py::test_snapshot_generates_hasrepr - TypeError: ... 260s FAILED tests/test_code_repr.py::test_enum_in_dataclass - TypeError: CliRunner... 260s FAILED tests/test_code_repr.py::test_flag - TypeError: CliRunner.__init__() g... 260s FAILED tests/test_code_repr.py::test_type - TypeError: CliRunner.__init__() g... 260s FAILED tests/test_code_repr.py::test_qualname - assert None == ('TypeError:\n... 260s FAILED tests/test_code_repr.py::test_invalid_repr - TypeError: CliRunner.__in... 260s FAILED tests/test_config.py::test_config_pyproject - AssertionError: assert {... 260s FAILED tests/test_config.py::test_config_env - AssertionError: assert {'test_... 260s FAILED tests/test_config.py::test_shortcuts - AssertionError: assert {'test_a... 260s FAILED tests/test_config.py::test_default_shortcuts - AssertionError: assert ... 260s FAILED tests/test_dirty_equals.py::test_compare_dirty_equals_twice - assert N... 260s FAILED tests/test_dirty_equals.py::test_dirty_equals_with_changing_args - ass... 260s FAILED tests/test_example.py::test_example - AssertionError: assert [] == ['f... 260s FAILED tests/test_external.py::test_basic - TypeError: CliRunner.__init__() g... 260s FAILED tests/test_external.py::test_persist - TypeError: CliRunner.__init__()... 260s FAILED tests/test_external.py::test_pytest_compare_external - TypeError: CliR... 260s FAILED tests/test_external.py::test_pytest_compare_external_bytes - TypeError... 260s FAILED tests/test_external.py::test_pytest_existing_external_import - TypeErr... 260s FAILED tests/test_external.py::test_pytest_trim_external - TypeError: CliRunn... 260s FAILED tests/test_external.py::test_pytest_new_external - TypeError: CliRunne... 260s FAILED tests/test_external.py::test_pytest_config_hash_length - TypeError: Cl... 260s FAILED tests/test_external.py::test_no_imports - AssertionError: assert {'err... 260s FAILED tests/test_external.py::test_ensure_imports - TypeError: CliRunner.__i... 260s FAILED tests/test_external.py::test_ensure_imports_with_comment - TypeError: ... 260s FAILED tests/test_external.py::test_new_externals - TypeError: CliRunner.__in... 260s FAILED tests/test_formating.py::test_black_formatting_error - assert None == ... 260s FAILED tests/test_formating.py::test_fstring_139 - AssertionError: assert 1 == 0 260s [assert 4 == snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 == snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 == snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 == snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 == snapshot(2+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 == snapshot({0: 2+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 <= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 <= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 <= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 <= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 <= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 <= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 <= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 <= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 >= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 >= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 >= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 >= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 >= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 4 >= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 >= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 >= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot([4, 5])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot({0: [4, 5]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot([])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot({0: []})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot([3+2])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s [assert 5 in snapshot({0: [3+2]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(==)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(==)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(==)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(<=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(>=)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) create(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) trim(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) fix(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(in) update(in)] 260s FAILED tests/test_inline_snapshot.py::test_mutable_values - TypeError: CliRun... 260s FAILED tests/test_inline_snapshot.py::test_comparison - TypeError: CliRunner.... 260s FAILED tests/test_inline_snapshot.py::test_ge - TypeError: CliRunner.__init__... 260s FAILED tests/test_inline_snapshot.py::test_le - TypeError: CliRunner.__init__... 260s FAILED tests/test_inline_snapshot.py::test_contains - TypeError: CliRunner.__... 260s FAILED tests/test_inline_snapshot.py::test_getitem - TypeError: CliRunner.__i... 260s FAILED tests/test_inline_snapshot.py::test_assert - TypeError: CliRunner.__in... 260s FAILED tests/test_inline_snapshot.py::test_format_file - TypeError: CliRunner... 260s FAILED tests/test_inline_snapshot.py::test_format_value - TypeError: CliRunne... 260s FAILED tests/test_inline_snapshot.py::test_type_error - TypeError: CliRunner.... 260s FAILED tests/test_inline_snapshot.py::test_different_snapshot_name - TypeErro... 260s FAILED tests/test_inline_snapshot.py::test_quoting_change_is_no_update - Type... 260s FAILED tests/test_inline_snapshot.py::test_trailing_comma - TypeError: CliRun... 260s FAILED tests/test_inline_snapshot.py::test_is - assert None == ('TypeError:\n... 260s FAILED tests/test_is.py::test_missing_is - TypeError: CliRunner.__init__() go... 260s FAILED tests/test_is_normalized.py::test_repr - assert None == ('TypeError:\n... 260s FAILED tests/test_preserve_values.py::test_fix_list_fix - TypeError: CliRunne... 260s FAILED tests/test_preserve_values.py::test_fix_list_insert - TypeError: CliRu... 260s FAILED tests/test_preserve_values.py::test_fix_list_delete - TypeError: CliRu... 260s FAILED tests/test_preserve_values.py::test_fix_tuple_delete - TypeError: CliR... 260s FAILED tests/test_preserve_values.py::test_fix_dict_change - TypeError: CliRu... 260s FAILED tests/test_preserve_values.py::test_fix_dict_remove - TypeError: CliRu... 260s FAILED tests/test_preserve_values.py::test_fix_dict_insert - TypeError: CliRu... 260s FAILED tests/test_preserve_values.py::test_fix_dict_with_non_literal_keys - T... 260s FAILED tests/test_preserve_values.py::test_no_update_for_dirty_equals - TypeE... 260s FAILED tests/test_preserve_values.py::test_preserve_case_from_original_mr - T... 260s [[5, 5, 5] -> [] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 260s [[5, 5, 2+2] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 5, 3] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 260s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 260s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 2+2, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 2+2] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 2+2, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 2+2, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 3, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 3] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 3, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 3, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 260s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 260s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 260s [[] -> [8, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2] -> [8, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3] -> [8, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 5] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2] -> [8, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 2+2] -> [8, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 3] -> [8, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 5] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3] -> [8, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 2+2] -> [8, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 3] -> [8, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 5, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 5, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 5, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2] -> [4, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 2+2] -> [4, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 3] -> [4, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 2+2, 5] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 2+2] -> [4, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 2+2, 2+2] -> [4, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 2+2, 3] -> [4, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 3, 5] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 3] -> [4, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 3, 2+2] -> [4, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[2+2, 3, 3] -> [4, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 5, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 5, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 5, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3] -> [3, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 2+2] -> [3, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 3] -> [3, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 2+2, 5] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 2+2] -> [3, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 2+2, 2+2] -> [3, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 2+2, 3] -> [3, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 3, 5] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 3] -> [3, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [[3, 3, 2+2] -> [3, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 5, 5) -> () ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 260s [(5, 5, 2+2) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 5, 3) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 260s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 260s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 2+2, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 2+2) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 2+2, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 2+2, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 3, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 3) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 3, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 3, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 260s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 260s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 260s [() -> (8, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2,) -> (8, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3,) -> (8, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 5) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2,) -> (8, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 2+2) -> (8, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 3) -> (8, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 5) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3,) -> (8, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 2+2) -> (8, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 3) -> (8, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 5, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 5, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 5, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2,) -> (4, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 2+2) -> (4, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 3) -> (4, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 2+2, 5) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 2+2) -> (4, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 2+2, 2+2) -> (4, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 2+2, 3) -> (4, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 3, 5) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 3) -> (4, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 3, 2+2) -> (4, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(2+2, 3, 3) -> (4, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 5, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 5, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 5, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3,) -> (3, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 2+2) -> (3, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 3) -> (3, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 2+2, 5) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 2+2) -> (3, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 2+2, 2+2) -> (3, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 2+2, 3) -> (3, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 3, 5) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 3) -> (3, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [(3, 3, 2+2) -> (3, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 5, 2: 5} -> {} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 5} -> {2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 5, 2: 3} -> {2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 2: 5} -> {1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5} -> {1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 2: 3} -> {1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 3, 2: 5} -> {1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 3} -> {1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 5, 2: 5} -> {0: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 5} -> {0: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 5, 2: 3} -> {0: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{2: 5} -> {0: 8, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{} -> {0: 8, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{2: 3} -> {0: 8, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 3, 2: 5} -> {0: 8, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 3} -> {0: 8, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 5, 2: 5} -> {0: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 5} -> {0: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 2: 5} -> {0: 3, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3} -> {0: 3, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 260s FAILED tests/test_pydantic.py::test_pydantic_create_snapshot - AssertionError... 260s FAILED tests/test_pydantic.py::test_pydantic_field_repr - AssertionError: ass... 260s FAILED tests/test_pydantic.py::test_pydantic_default_value - AssertionError: ... 260s FAILED tests/test_pydantic.py::test_pydantic_factory_method - AssertionError:... 260s FAILED tests/test_pypy.py::test_pypy - TypeError: CliRunner.__init__() got an... 260s FAILED tests/test_pytest_plugin.py::test_create - AssertionError: assert {'er... 260s FAILED tests/test_pytest_plugin.py::test_fix - AssertionError: assert {'error... 260s FAILED tests/test_pytest_plugin.py::test_update - AssertionError: assert {'er... 260s FAILED tests/test_pytest_plugin.py::test_trim - TypeError: CliRunner.__init__... 260s FAILED tests/test_pytest_plugin.py::test_multiple - AssertionError: assert {'... 260s FAILED tests/test_pytest_plugin.py::test_multiple_report - TypeError: CliRunn... 260s FAILED tests/test_pytest_plugin.py::test_black_config - TypeError: CliRunner.... 260s FAILED tests/test_pytest_plugin.py::test_disabled - TypeError: CliRunner.__in... 260s FAILED tests/test_pytest_plugin.py::test_compare - TypeError: CliRunner.__ini... 260s FAILED tests/test_pytest_plugin.py::test_assertion_error_loop - TypeError: Cl... 260s FAILED tests/test_pytest_plugin.py::test_assertion_error - TypeError: CliRunn... 260s FAILED tests/test_pytest_plugin.py::test_pytest_inlinesnapshot_auto - TypeErr... 260s FAILED tests/test_pytest_plugin.py::test_persist_unknown_external - TypeError... 260s FAILED tests/test_pytest_plugin.py::test_diff_multiple_files - TypeError: Cli... 260s FAILED tests/test_pytest_plugin.py::test_storage_dir_config[tests/snapshots] 260s FAILED tests/test_pytest_plugin.py::test_storage_dir_config[None] - assert /dev/null) ; do cd "$AUTOPKGTEST_TMP" ; echo "Testing with $py:" ; $py -c "import inline_snapshot; print(inline_snapshot)" ; done 501s autopkgtest [04:16:25]: test autodep8-python3: [----------------------- 501s Testing with python3.12: 501s 501s Testing with python3.13: 502s 502s autopkgtest [04:16:30]: test autodep8-python3: -----------------------] 530s autopkgtest [04:16:58]: test autodep8-python3: - - - - - - - - - - results - - - - - - - - - - 530s autodep8-python3 PASS (superficial) 531s autopkgtest [04:16:59]: @@@@@@@@@@@@@@@@@@@@ summary 531s upstream-tests FAIL non-zero exit status 1 531s autodep8-python3 PASS (superficial) 546s nova [W] Using flock in prodstack6-arm64 546s Creating nova instance adt-plucky-arm64-python-inline-snapshot-20250219-040807-juju-7f2275-prod-proposed-migration-environment-15-c18b2f7f-68f1-439a-a575-be01ae633eaa from image adt/ubuntu-plucky-arm64-server-20250218.img (UUID db1e3557-ca0b-4978-8424-9ef955671030)... 546s nova [W] Timed out waiting for 98794607-7e90-42c3-abed-05c81ede72f5 to get deleted. 546s nova [W] Using flock in prodstack6-arm64 546s Creating nova instance adt-plucky-arm64-python-inline-snapshot-20250219-040807-juju-7f2275-prod-proposed-migration-environment-15-c18b2f7f-68f1-439a-a575-be01ae633eaa from image adt/ubuntu-plucky-arm64-server-20250218.img (UUID db1e3557-ca0b-4978-8424-9ef955671030)... 546s nova [W] Timed out waiting for e92d56eb-6319-448e-bfa7-c4f8d22062d3 to get deleted.