0s autopkgtest [04:28:53]: starting date and time: 2025-02-19 04:28:53+0000 0s autopkgtest [04:28:53]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [04:28:53]: host juju-7f2275-prod-proposed-migration-environment-20; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.x40eyjm9/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-s390x --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-20@bos03-s390x-20.secgroup --name adt-plucky-s390x-python-inline-snapshot-20250219-042852-juju-7f2275-prod-proposed-migration-environment-20-0662d63a-310f-42f7-9cf7-a926d48007b3 --image adt/ubuntu-plucky-s390x-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-20 --net-id=net_prod-proposed-migration-s390x -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/ 120s autopkgtest [04:30:53]: testbed dpkg architecture: s390x 121s autopkgtest [04:30:54]: testbed apt version: 2.9.29 121s autopkgtest [04:30:54]: @@@@@@@@@@@@@@@@@@@@ test bed setup 121s autopkgtest [04:30:54]: testbed release detected to be: None 122s autopkgtest [04:30:55]: updating testbed package index (apt update) 122s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [110 kB] 122s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 122s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 123s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 123s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [3120 B] 123s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [79.1 kB] 123s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [788 kB] 123s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.6 kB] 123s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x Packages [98.8 kB] 123s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted s390x Packages [760 B] 123s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe s390x Packages [656 kB] 123s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse s390x Packages [5192 B] 123s Fetched 1755 kB in 1s (1875 kB/s) 124s Reading package lists... 124s Reading package lists... 124s Building dependency tree... 124s Reading state information... 124s Calculating upgrade... 125s The following packages were automatically installed and are no longer required: 125s libnsl2 libpython3.12-minimal libpython3.12-stdlib libpython3.12t64 125s linux-headers-6.11.0-8 linux-headers-6.11.0-8-generic 125s linux-modules-6.11.0-8-generic linux-tools-6.11.0-8 125s linux-tools-6.11.0-8-generic 125s Use 'sudo apt autoremove' to remove them. 125s The following packages will be upgraded: 125s dhcpcd-base s390-tools s390-tools-data s390-tools-signed 125s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 125s Need to get 5637 kB of archives. 125s After this operation, 54.3 kB of additional disk space will be used. 125s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x dhcpcd-base s390x 1:10.1.0-7 [219 kB] 125s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x s390-tools-data all 2.37.0-0ubuntu2 [20.4 kB] 125s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x s390-tools s390x 2.37.0-0ubuntu2 [5385 kB] 125s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x s390-tools-signed all 2.37.0-0ubuntu2 [12.4 kB] 126s Fetched 5637 kB in 1s (6771 kB/s) 126s (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 ... 80980 files and directories currently installed.) 126s Preparing to unpack .../dhcpcd-base_1%3a10.1.0-7_s390x.deb ... 126s Unpacking dhcpcd-base (1:10.1.0-7) over (1:10.1.0-6) ... 126s Preparing to unpack .../s390-tools-data_2.37.0-0ubuntu2_all.deb ... 126s Unpacking s390-tools-data (2.37.0-0ubuntu2) over (2.37.0-0ubuntu1) ... 126s Preparing to unpack .../s390-tools_2.37.0-0ubuntu2_s390x.deb ... 126s Unpacking s390-tools (2.37.0-0ubuntu2) over (2.37.0-0ubuntu1) ... 126s Preparing to unpack .../s390-tools-signed_2.37.0-0ubuntu2_all.deb ... 126s Unpacking s390-tools-signed (2.37.0-0ubuntu2) over (2.37.0-0ubuntu1) ... 126s Setting up s390-tools-signed (2.37.0-0ubuntu2) ... 126s Setting up dhcpcd-base (1:10.1.0-7) ... 126s Setting up s390-tools-data (2.37.0-0ubuntu2) ... 126s Setting up s390-tools (2.37.0-0ubuntu2) ... 127s Processing triggers for man-db (2.13.0-1) ... 128s Processing triggers for initramfs-tools (0.145ubuntu2) ... 128s update-initramfs: Generating /boot/initrd.img-6.12.0-15-generic 128s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 132s Using config file '/etc/zipl.conf' 132s Building bootmap in '/boot' 132s Adding IPL section 'ubuntu' (default) 132s Preparing boot device for LD-IPL: vda (0000). 132s Done. 133s Reading package lists... 133s Building dependency tree... 133s Reading state information... 133s The following packages will be REMOVED: 133s libnsl2* libpython3.12-minimal* libpython3.12-stdlib* libpython3.12t64* 133s linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 133s linux-modules-6.11.0-8-generic* linux-tools-6.11.0-8* 133s linux-tools-6.11.0-8-generic* 133s 0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded. 133s After this operation, 167 MB disk space will be freed. 133s (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 ... 80981 files and directories currently installed.) 133s Removing linux-tools-6.11.0-8-generic (6.11.0-8.8) ... 133s Removing linux-tools-6.11.0-8 (6.11.0-8.8) ... 133s Removing libpython3.12t64:s390x (3.12.9-1) ... 133s Removing libpython3.12-stdlib:s390x (3.12.9-1) ... 133s Removing libnsl2:s390x (1.3.0-3build3) ... 133s Removing libpython3.12-minimal:s390x (3.12.9-1) ... 133s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 133s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 134s Removing linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 135s Processing triggers for libc-bin (2.40-4ubuntu1) ... 135s (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 ... 55881 files and directories currently installed.) 135s Purging configuration files for libpython3.12-minimal:s390x (3.12.9-1) ... 135s Purging configuration files for linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 135s autopkgtest [04:31:08]: upgrading testbed (apt dist-upgrade and autopurge) 135s Reading package lists... 135s Building dependency tree... 135s Reading state information... 135s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 135s Starting 2 pkgProblemResolver with broken count: 0 135s Done 136s Entering ResolveByKeep 136s 136s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 137s Reading package lists... 137s Building dependency tree... 137s Reading state information... 137s Starting pkgProblemResolver with broken count: 0 137s Starting 2 pkgProblemResolver with broken count: 0 137s Done 137s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 137s autopkgtest [04:31:10]: rebooting testbed after setup commands that affected boot 141s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 159s autopkgtest [04:31:32]: testbed running kernel: Linux 6.12.0-15-generic #15-Ubuntu SMP Tue Feb 4 15:05:57 UTC 2025 161s autopkgtest [04:31:34]: @@@@@@@@@@@@@@@@@@@@ apt-source python-inline-snapshot 163s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (dsc) [3233 B] 163s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (tar) [87.9 kB] 163s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (diff) [7508 B] 164s gpgv: Signature made Thu Jan 16 17:58:09 2025 UTC 164s gpgv: using RSA key FC875C834BC71FB6546250A86E25BF686AA7D62A 164s gpgv: issuer "katharasasikumar007@gmail.com" 164s gpgv: Can't check signature: No public key 164s dpkg-source: warning: cannot verify inline signature for ./python-inline-snapshot_0.19.3-1.dsc: no acceptable signature found 164s autopkgtest [04:31:37]: testing package python-inline-snapshot version 0.19.3-1 164s autopkgtest [04:31:37]: build not needed 165s autopkgtest [04:31:38]: test upstream-tests: preparing testbed 165s Reading package lists... 165s Building dependency tree... 165s Reading state information... 165s Starting pkgProblemResolver with broken count: 0 165s Starting 2 pkgProblemResolver with broken count: 0 165s Done 165s The following NEW packages will be installed: 165s black libnsl2 libpython3.12-minimal libpython3.12-stdlib 165s python-inline-snapshot-doc python3-all python3-annotated-types 165s python3-asttokens python3-click python3-dateutil python3-dirty-equals 165s python3-dnspython python3-email-validator python3-executing 165s python3-freezegun python3-hypothesis python3-iniconfig 165s python3-inline-snapshot python3-mypy-extensions python3-packaging 165s python3-pathspec python3-platformdirs python3-pluggy python3-pydantic 165s python3-pydantic-core python3-pytest python3-pytest-freezer 165s python3-pytest-mock python3-pytest-subtests python3-sortedcontainers 165s python3-time-machine python3.12 python3.12-minimal 166s 0 upgraded, 33 newly installed, 0 to remove and 0 not upgraded. 166s Need to get 12.4 MB of archives. 166s After this operation, 60.1 MB of additional disk space will be used. 166s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.12-minimal s390x 3.12.9-1 [836 kB] 166s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x python3.12-minimal s390x 3.12.9-1 [2403 kB] 166s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x libnsl2 s390x 1.3.0-3build3 [44.1 kB] 166s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.12-stdlib s390x 3.12.9-1 [2071 kB] 166s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x python3.12 s390x 3.12.9-1 [671 kB] 166s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-click all 8.2.0-1 [81.9 kB] 166s Get:7 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-mypy-extensions all 1.0.0-1 [6148 B] 166s Get:8 http://ftpmaster.internal/ubuntu plucky/main s390x python3-packaging all 24.2-1 [51.5 kB] 166s Get:9 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pathspec all 0.12.1-1 [24.5 kB] 166s Get:10 http://ftpmaster.internal/ubuntu plucky/main s390x python3-platformdirs all 4.3.6-1 [16.8 kB] 166s Get:11 http://ftpmaster.internal/ubuntu plucky/universe s390x black s390x 25.1.0-1 [1828 kB] 166s Get:12 http://ftpmaster.internal/ubuntu plucky/universe s390x python-inline-snapshot-doc all 0.19.3-1 [541 kB] 166s Get:13 http://ftpmaster.internal/ubuntu plucky/main s390x python3-all s390x 3.13.1-1~exp2 [898 B] 166s Get:14 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-annotated-types all 0.7.0-1 [19.4 kB] 166s Get:15 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-asttokens all 3.0.0-1 [20.4 kB] 166s Get:16 http://ftpmaster.internal/ubuntu plucky/main s390x python3-dateutil all 2.9.0-3 [80.2 kB] 166s Get:17 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-dirty-equals all 0.9.0-1 [23.2 kB] 166s Get:18 http://ftpmaster.internal/ubuntu plucky/main s390x python3-dnspython all 2.7.0-1ubuntu1 [167 kB] 166s Get:19 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-email-validator all 2.2.0-1 [28.5 kB] 166s Get:20 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-executing all 2.2.0-0.1 [25.0 kB] 166s Get:21 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-freezegun all 1.5.1-1.2 [15.9 kB] 166s Get:22 http://ftpmaster.internal/ubuntu plucky/main s390x python3-sortedcontainers all 2.4.0-2 [27.6 kB] 166s Get:23 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-hypothesis all 6.125.2-1 [333 kB] 166s Get:24 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-iniconfig all 1.1.1-2 [6024 B] 166s Get:25 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-inline-snapshot all 0.19.3-1 [32.5 kB] 166s Get:26 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pluggy all 1.5.0-1 [21.0 kB] 166s Get:27 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pydantic-core s390x 2.27.2-1 [2384 kB] 167s Get:28 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pydantic s390x 2.10.6-1 [288 kB] 167s Get:29 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest all 8.3.4-1 [252 kB] 167s Get:30 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest-freezer all 0.4.9-1 [4542 B] 167s Get:31 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest-mock all 3.14.0-2 [11.7 kB] 167s Get:32 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest-subtests all 0.13.1-1 [10.8 kB] 167s Get:33 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-time-machine s390x 2.16.0-1 [24.6 kB] 167s Fetched 12.4 MB in 1s (9654 kB/s) 167s Selecting previously unselected package libpython3.12-minimal:s390x. 167s (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 ... 55879 files and directories currently installed.) 167s Preparing to unpack .../00-libpython3.12-minimal_3.12.9-1_s390x.deb ... 167s Unpacking libpython3.12-minimal:s390x (3.12.9-1) ... 167s Selecting previously unselected package python3.12-minimal. 167s Preparing to unpack .../01-python3.12-minimal_3.12.9-1_s390x.deb ... 167s Unpacking python3.12-minimal (3.12.9-1) ... 167s Selecting previously unselected package libnsl2:s390x. 167s Preparing to unpack .../02-libnsl2_1.3.0-3build3_s390x.deb ... 167s Unpacking libnsl2:s390x (1.3.0-3build3) ... 167s Selecting previously unselected package libpython3.12-stdlib:s390x. 167s Preparing to unpack .../03-libpython3.12-stdlib_3.12.9-1_s390x.deb ... 167s Unpacking libpython3.12-stdlib:s390x (3.12.9-1) ... 167s Selecting previously unselected package python3.12. 167s Preparing to unpack .../04-python3.12_3.12.9-1_s390x.deb ... 167s Unpacking python3.12 (3.12.9-1) ... 167s Selecting previously unselected package python3-click. 167s Preparing to unpack .../05-python3-click_8.2.0-1_all.deb ... 167s Unpacking python3-click (8.2.0-1) ... 167s Selecting previously unselected package python3-mypy-extensions. 167s Preparing to unpack .../06-python3-mypy-extensions_1.0.0-1_all.deb ... 167s Unpacking python3-mypy-extensions (1.0.0-1) ... 167s Selecting previously unselected package python3-packaging. 167s Preparing to unpack .../07-python3-packaging_24.2-1_all.deb ... 167s Unpacking python3-packaging (24.2-1) ... 167s Selecting previously unselected package python3-pathspec. 167s Preparing to unpack .../08-python3-pathspec_0.12.1-1_all.deb ... 167s Unpacking python3-pathspec (0.12.1-1) ... 167s Selecting previously unselected package python3-platformdirs. 167s Preparing to unpack .../09-python3-platformdirs_4.3.6-1_all.deb ... 167s Unpacking python3-platformdirs (4.3.6-1) ... 167s Selecting previously unselected package black. 167s Preparing to unpack .../10-black_25.1.0-1_s390x.deb ... 167s Unpacking black (25.1.0-1) ... 167s Selecting previously unselected package python-inline-snapshot-doc. 167s Preparing to unpack .../11-python-inline-snapshot-doc_0.19.3-1_all.deb ... 167s Unpacking python-inline-snapshot-doc (0.19.3-1) ... 167s Selecting previously unselected package python3-all. 167s Preparing to unpack .../12-python3-all_3.13.1-1~exp2_s390x.deb ... 167s Unpacking python3-all (3.13.1-1~exp2) ... 167s Selecting previously unselected package python3-annotated-types. 167s Preparing to unpack .../13-python3-annotated-types_0.7.0-1_all.deb ... 167s Unpacking python3-annotated-types (0.7.0-1) ... 167s Selecting previously unselected package python3-asttokens. 167s Preparing to unpack .../14-python3-asttokens_3.0.0-1_all.deb ... 167s Unpacking python3-asttokens (3.0.0-1) ... 167s Selecting previously unselected package python3-dateutil. 167s Preparing to unpack .../15-python3-dateutil_2.9.0-3_all.deb ... 167s Unpacking python3-dateutil (2.9.0-3) ... 167s Selecting previously unselected package python3-dirty-equals. 167s Preparing to unpack .../16-python3-dirty-equals_0.9.0-1_all.deb ... 167s Unpacking python3-dirty-equals (0.9.0-1) ... 167s Selecting previously unselected package python3-dnspython. 167s Preparing to unpack .../17-python3-dnspython_2.7.0-1ubuntu1_all.deb ... 167s Unpacking python3-dnspython (2.7.0-1ubuntu1) ... 167s Selecting previously unselected package python3-email-validator. 167s Preparing to unpack .../18-python3-email-validator_2.2.0-1_all.deb ... 167s Unpacking python3-email-validator (2.2.0-1) ... 168s Selecting previously unselected package python3-executing. 168s Preparing to unpack .../19-python3-executing_2.2.0-0.1_all.deb ... 168s Unpacking python3-executing (2.2.0-0.1) ... 168s Selecting previously unselected package python3-freezegun. 168s Preparing to unpack .../20-python3-freezegun_1.5.1-1.2_all.deb ... 168s Unpacking python3-freezegun (1.5.1-1.2) ... 168s Selecting previously unselected package python3-sortedcontainers. 168s Preparing to unpack .../21-python3-sortedcontainers_2.4.0-2_all.deb ... 168s Unpacking python3-sortedcontainers (2.4.0-2) ... 168s Selecting previously unselected package python3-hypothesis. 168s Preparing to unpack .../22-python3-hypothesis_6.125.2-1_all.deb ... 168s Unpacking python3-hypothesis (6.125.2-1) ... 168s Selecting previously unselected package python3-iniconfig. 168s Preparing to unpack .../23-python3-iniconfig_1.1.1-2_all.deb ... 168s Unpacking python3-iniconfig (1.1.1-2) ... 168s Selecting previously unselected package python3-inline-snapshot. 168s Preparing to unpack .../24-python3-inline-snapshot_0.19.3-1_all.deb ... 168s Unpacking python3-inline-snapshot (0.19.3-1) ... 168s Selecting previously unselected package python3-pluggy. 168s Preparing to unpack .../25-python3-pluggy_1.5.0-1_all.deb ... 168s Unpacking python3-pluggy (1.5.0-1) ... 168s Selecting previously unselected package python3-pydantic-core. 168s Preparing to unpack .../26-python3-pydantic-core_2.27.2-1_s390x.deb ... 168s Unpacking python3-pydantic-core (2.27.2-1) ... 168s Selecting previously unselected package python3-pydantic. 168s Preparing to unpack .../27-python3-pydantic_2.10.6-1_s390x.deb ... 168s Unpacking python3-pydantic (2.10.6-1) ... 168s Selecting previously unselected package python3-pytest. 168s Preparing to unpack .../28-python3-pytest_8.3.4-1_all.deb ... 168s Unpacking python3-pytest (8.3.4-1) ... 168s Selecting previously unselected package python3-pytest-freezer. 168s Preparing to unpack .../29-python3-pytest-freezer_0.4.9-1_all.deb ... 168s Unpacking python3-pytest-freezer (0.4.9-1) ... 168s Selecting previously unselected package python3-pytest-mock. 168s Preparing to unpack .../30-python3-pytest-mock_3.14.0-2_all.deb ... 168s Unpacking python3-pytest-mock (3.14.0-2) ... 168s Selecting previously unselected package python3-pytest-subtests. 168s Preparing to unpack .../31-python3-pytest-subtests_0.13.1-1_all.deb ... 168s Unpacking python3-pytest-subtests (0.13.1-1) ... 168s Selecting previously unselected package python3-time-machine. 168s Preparing to unpack .../32-python3-time-machine_2.16.0-1_s390x.deb ... 168s Unpacking python3-time-machine (2.16.0-1) ... 168s Setting up python3-iniconfig (1.1.1-2) ... 168s Setting up python3-pydantic-core (2.27.2-1) ... 168s Setting up python3-asttokens (3.0.0-1) ... 168s Setting up python3-mypy-extensions (1.0.0-1) ... 168s Setting up python3-dirty-equals (0.9.0-1) ... 169s Setting up libpython3.12-minimal:s390x (3.12.9-1) ... 169s Setting up python3-sortedcontainers (2.4.0-2) ... 169s Setting up python3-click (8.2.0-1) ... 169s Setting up python3-annotated-types (0.7.0-1) ... 169s Setting up python3-platformdirs (4.3.6-1) ... 169s Setting up python3-packaging (24.2-1) ... 169s Setting up python3-executing (2.2.0-0.1) ... 169s Setting up python3-pluggy (1.5.0-1) ... 170s Setting up python3-dnspython (2.7.0-1ubuntu1) ... 170s Setting up libnsl2:s390x (1.3.0-3build3) ... 170s Setting up python3-dateutil (2.9.0-3) ... 170s Setting up python3-email-validator (2.2.0-1) ... 170s Setting up python-inline-snapshot-doc (0.19.3-1) ... 170s Setting up python3-pathspec (0.12.1-1) ... 171s Setting up python3-freezegun (1.5.1-1.2) ... 171s Setting up python3.12-minimal (3.12.9-1) ... 171s Setting up libpython3.12-stdlib:s390x (3.12.9-1) ... 171s Setting up python3-pytest (8.3.4-1) ... 172s Setting up python3.12 (3.12.9-1) ... 173s Setting up python3-hypothesis (6.125.2-1) ... 174s Setting up python3-all (3.13.1-1~exp2) ... 174s Setting up black (25.1.0-1) ... 174s Setting up python3-time-machine (2.16.0-1) ... 174s Setting up python3-inline-snapshot (0.19.3-1) ... 174s Setting up python3-pydantic (2.10.6-1) ... 175s Setting up python3-pytest-freezer (0.4.9-1) ... 175s Setting up python3-pytest-mock (3.14.0-2) ... 175s Setting up python3-pytest-subtests (0.13.1-1) ... 175s Processing triggers for systemd (257.2-3ubuntu1) ... 175s Processing triggers for man-db (2.13.0-1) ... 176s Processing triggers for libc-bin (2.40-4ubuntu1) ... 177s autopkgtest [04:31:50]: test upstream-tests: [----------------------- 177s 177s *************************** 177s *** Testing with python3.12 177s *************************** 177s 177s Content of current working folder: 177s 177s total 12 177s drwxr-xr-x 3 ubuntu ubuntu 4096 Feb 19 04:31 . 177s drwxrwxrwt 5 root root 4096 Feb 19 04:31 .. 177s drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 15 18:43 tests 177s Running tests... 177s 178s ============================= test session starts ============================== 178s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 178s rootdir: /tmp/autopkgtest.gRE7zS/autopkgtest_tmp 178s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 178s collected 392 items / 10 deselected / 382 selected 178s 184s tests/adapter/test_dataclass.py FFFFEFE.FF.F.FEFEFEFF [ 4%] 184s tests/adapter/test_dict.py F [ 4%] 185s tests/adapter/test_general.py F. [ 4%] 185s tests/adapter/test_sequence.py FF..F [ 6%] 185s tests/test_align.py . [ 6%] 185s tests/test_change.py F [ 6%] 186s tests/test_code_repr.py FF.FFFF.............................F [ 16%] 190s tests/test_config.py FEFEFEFE [ 17%] 190s tests/test_dirty_equals.py xF..F [ 18%] 190s tests/test_docs.py .s [ 19%] 191s tests/test_example.py FE [ 19%] 199s tests/test_external.py F..FFFFFFF..FFFF [ 23%] 201s tests/test_formating.py FF.. [ 24%] 201s tests/test_fstring.py .. [ 25%] 201s tests/test_hasrepr.py . [ 25%] 202s tests/test_inline_snapshot.py ..uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.,,,,,,,,, [ 26%] 203s ,,,,,,,,,,,,,,,,,,,,,.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 39%] 205s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,,.,,.,,,.,,.,,., [ 55%] 205s ,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,, [ 61%] 206s .,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,. [ 67%] 206s ,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,, [ 73%] 206s ,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,. [ 79%] 206s ,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.FFFFFFF...FF.FFFF..F [ 86%] 206s tests/test_is.py F [ 87%] 206s tests/test_is_normalized.py F [ 87%] 208s tests/test_preserve_values.py FFFFFFFFFFuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 210s uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 212s uuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 213s uuuuuuuuuuuuuuu,. [ 90%] 217s tests/test_pydantic.py FEFEFE.FE [ 91%] 218s tests/test_pypy.py F [ 91%] 234s tests/test_pytest_plugin.py .FFFFF.FFFFF.F.FFF..FFFE [ 97%] 234s tests/test_raises.py . [ 98%] 234s tests/test_rewrite_code.py .F [ 98%] 236s tests/test_string.py FFF. [ 99%] 236s tests/test_warns.py . [100%] 236s 236s ==================================== ERRORS ==================================== 236s ________________ ERROR at teardown of test_attrs_default_value _________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s import attrs 236s 236s @attrs.define 236s class A: 236s a:int 236s b:int=2 236s c:list=attrs.field(factory=list) 236s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 236s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpy7dr8ot3 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_something ________________________________ 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 236s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 236s 236s test_something.py:13: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmpy7dr8ot3/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 236s ============================== 1 failed in 0.17s =============================== 236s 236s stderr: 236s 236s __________________ ERROR at teardown of test_attrs_field_repr __________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s import attrs 236s 236s @attrs.define 236s class container: 236s a: int 236s b: int = attrs.field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot() 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmp7jwfv83i 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 0 items / 1 error 236s 236s ==================================== ERRORS ==================================== 236s ______________________ ERROR collecting test_something.py ______________________ 236s test_something.py:9: in 236s assert container(a=1,b=5) == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 236s runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 236s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 236s =============================== 1 error in 0.25s =============================== 236s 236s stderr: 236s 236s _____________ ERROR at teardown of test_remove_positional_argument _____________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s 236s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 236s 236s 236s class L: 236s def __init__(self,*l): 236s self.l=l 236s 236s def __eq__(self,other): 236s if not isinstance(other,L): 236s return NotImplemented 236s return other.l==self.l 236s 236s class LAdapter(GenericCallAdapter): 236s @classmethod 236s def check_type(cls, typ): 236s return issubclass(typ,L) 236s 236s @classmethod 236s def arguments(cls, value): 236s return ([Argument(x) for x in value.l],{}) 236s 236s @classmethod 236s def argument(cls, value, pos_or_name): 236s assert isinstance(pos_or_name,int) 236s return value.l[pos_or_name] 236s 236s def test_L1(): 236s assert L(1,2) == snapshot(L(1)), "not equal" 236s 236s def test_L2(): 236s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpl25feuk6 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 2 items 236s 236s test_something.py F. [100%] 236s 236s =================================== FAILURES =================================== 236s ___________________________________ test_L1 ____________________________________ 236s 236s def test_L1(): 236s > assert L(1,2) == snapshot(L(1)), "not equal" 236s 236s test_something.py:30: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 236s new_code=self.context.file._value_to_code(value.value), 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmpl25feuk6/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s ──────────────────────────────── Fix snapshots ───────────────────────────────── 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 236s diff = file.diff() 236s ^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 236s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 236s ^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s ^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _____________________ ERROR at teardown of test_namedtuple _____________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from collections import namedtuple 236s 236s T=namedtuple("T","a,b") 236s 236s def test_tuple(): 236s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmplgnnk3di 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s __________________________________ test_tuple __________________________________ 236s 236s def test_tuple(): 236s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 236s 236s test_something.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmplgnnk3di/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 236s ============================== 1 failed in 0.20s =============================== 236s 236s stderr: 236s 236s ____________________ ERROR at teardown of test_defaultdict _____________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from collections import defaultdict 236s 236s 236s def test_tuple(): 236s d=defaultdict(list) 236s d[1].append(2) 236s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpgl9avv77 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s __________________________________ test_tuple __________________________________ 236s 236s def test_tuple(): 236s d=defaultdict(list) 236s d[1].append(2) 236s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 236s 236s test_something.py:8: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 236s result = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 236s result[key] = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 236s v = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmpgl9avv77/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 236s ============================== 1 failed in 0.24s =============================== 236s 236s stderr: 236s 236s __________________ ERROR at teardown of test_config_pyproject __________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s file: pyproject.toml 236s 236s [tool.inline-snapshot] 236s default-flags = ["trim"] 236s 236s 236s run> /usr/bin/python3.12 -m pytest 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpwk64vx64 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpwk64vx64/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _____________________ ERROR at teardown of test_config_env _____________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s run> /usr/bin/python3.12 -m pytest 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpxopo7dro 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpxopo7dro/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _____________________ ERROR at teardown of test_shortcuts ______________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s file: pyproject.toml 236s 236s [tool.inline-snapshot.shortcuts] 236s strim=["trim"] 236s 236s 236s run> /usr/bin/python3.12 -m pytest --strim 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpm6vbo6c5 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpm6vbo6c5/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _________________ ERROR at teardown of test_default_shortcuts __________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s file: pyproject.toml 236s 236s 236s 236s run> /usr/bin/python3.12 -m pytest --fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpdb9820i8 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpdb9820i8/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s ______________________ ERROR at teardown of test_example _______________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1==snapshot(2) 236s 236s 236s file: test_b.py 236s 1+1 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpv1ykmz0d 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert 1==snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpv1ykmz0d/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s ============================== 1 failed in 0.20s =============================== 236s 236s stderr: 236s 236s file: test_b.py 236s 1+1 236s 236s file: test_a.py 236s 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1==snapshot(2) 236s 236s 236s run> pytest /tmp/tmpfqqgbz6q/test_b.py 236s run> pytest /tmp/tmpfqqgbz6q/test_a.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpfqqgbz6q/test_a.py", line 5, in test_a 236s assert 1==snapshot(2) 236s ^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ______________ ERROR at teardown of test_pydantic_create_snapshot ______________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s 236s from pydantic import BaseModel 236s from inline_snapshot import snapshot 236s 236s class M(BaseModel): 236s size:int 236s name:str 236s age:int=4 236s 236s def test_pydantic(): 236s m=M(size=5,name="Tom") 236s assert m==snapshot() 236s assert m.dict()==snapshot() 236s 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpaflag6j5 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_pydantic _________________________________ 236s 236s def test_pydantic(): 236s m=M(size=5,name="Tom") 236s > assert m==snapshot() 236s 236s test_something.py:12: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '', filename = PosixPath('/tmp/tmpaflag6j5/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 236s ============================== 1 failed in 0.33s =============================== 236s 236s stderr: 236s 236s ________________ ERROR at teardown of test_pydantic_field_repr _________________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from pydantic import BaseModel,Field 236s 236s class container(BaseModel): 236s a: int 236s b: int = Field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot() 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmp84ld6a_8 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 0 items / 1 error 236s 236s ==================================== ERRORS ==================================== 236s ______________________ ERROR collecting test_something.py ______________________ 236s test_something.py:8: in 236s assert container(a=1,b=5) == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 236s runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 236s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 236s =============================== 1 error in 0.41s =============================== 236s 236s stderr: 236s 236s _______________ ERROR at teardown of test_pydantic_default_value _______________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s from pydantic import BaseModel,Field 236s 236s class A(BaseModel): 236s a:int 236s b:int=2 236s c:list=Field(default_factory=list) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmp3_rhhmed 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py . [100%] 236s =============================== inline snapshot ================================ 236s ─────────────────────────────── Update snapshots ─────────────────────────────── 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 236s diff = file.diff() 236s ^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 236s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 236s ^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s ^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s ______________ ERROR at teardown of test_pydantic_factory_method _______________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from pydantic import BaseModel 236s 236s class A(BaseModel): 236s a:int 236s 236s @classmethod 236s def from_str(cls,s): 236s return cls(a=int(s)) 236s 236s def test_something(): 236s for a in [1,2]: 236s assert A(a=2) == snapshot(A.from_str("1")) 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpyd16k68y 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_something ________________________________ 236s 236s def test_something(): 236s for a in [1,2]: 236s > assert A(a=2) == snapshot(A.from_str("1")) 236s 236s test_something.py:13: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 236s result = yield from self.value_assign(old_value, old_node, new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 236s result = yield from adapter.assign(old_value, old_node, new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = 'A (a =2 )', filename = PosixPath('/tmp/tmpyd16k68y/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 236s ============================== 1 failed in 0.28s =============================== 236s 236s stderr: 236s 236s ________ ERROR at teardown of test_find_pyproject_in_parent_directories ________ 236s some snapshots in this test have incorrect values. 236s ----------------------------- Captured stdout call ----------------------------- 236s file: pyproject.toml 236s [tool.inline-snapshot] 236s hash-length=2 236s 236s 236s file: project/pytest.ini 236s 236s 236s file: project/test_something.py 236s from inline_snapshot import outsource,snapshot,external 236s 236s def test_something(): 236s assert outsource("test") == snapshot() 236s 236s 236s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpge6v95hb/project 236s configfile: ../pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s project/test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_something ________________________________ 236s 236s def test_something(): 236s > assert outsource("test") == snapshot() 236s 236s project/test_something.py:4: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '', filename = PosixPath('/tmp/tmpge6v95hb/project/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 236s ============================== 1 failed in 0.27s =============================== 236s 236s stderr: 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_unmanaged ________________________________ 236s 236s def test_unmanaged(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s b:int 236s 236s def test_something(): 236s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s b:int 236s 236s def test_something(): 236s assert A(a=2,b=4) == snapshot(A(a=2,b=Is(1))), "not equal" 236s """ 236s } 236s ), 236s raises=snapshot( 236s """\ 236s AssertionError: 236s not equal\ 236s """ 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:21: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 236s assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/adapter/test_dataclass.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s b:int 236s 236s def test_something(): 236s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 236s 236s 236s run> pytest /tmp/tmpntj5stuh/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpntj5stuh/test_something.py", line 10, in test_something 236s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _________________________________ test_reeval __________________________________ 236s 236s def test_reeval(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s b:int 236s 236s def test_something(): 236s for c in "ab": 236s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s b:int 236s 236s def test_something(): 236s for c in "ab": 236s assert A(a=1,b=c) == snapshot(A(a=1,b=Is(c))) 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:63: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s b:int 236s 236s def test_something(): 236s for c in "ab": 236s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 236s 236s 236s run> pytest /tmp/tmporw5kcr8/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmporw5kcr8/test_something.py", line 11, in test_something 236s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _________________________ test_dataclass_default_value _________________________ 236s 236s def test_dataclass_default_value(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class A: 236s a:int 236s b:int=2 236s c:list=field(default_factory=list) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=update"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class A: 236s a:int 236s b:int=2 236s c:list=field(default_factory=list) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1)) 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:100: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:214: in run_inline 236s recorder.fix_all() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 236s file.rewrite() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 236s new_code = self.new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s 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' 236s filename = PosixPath('/tmp/tmp57prj9i3/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class A: 236s a:int 236s b:int=2 236s c:list=field(default_factory=list) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 236s 236s 236s run> pytest /tmp/tmp57prj9i3/test_something.py 236s ___________________________ test_attrs_default_value ___________________________ 236s 236s def test_attrs_default_value(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s import attrs 236s 236s @attrs.define 236s class A: 236s a:int 236s b:int=2 236s c:list=attrs.field(factory=list) 236s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 236s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 236s """ 236s > ).run_pytest( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s import attrs 236s 236s @attrs.define 236s class A: 236s a:int 236s b:int=2 236s c:list=attrs.field(factory=list) 236s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 236s assert A(a=2,b=3) == snapshot(A(a=2,b=3,c=[],d=11)) 236s """ 236s } 236s ), 236s ).run_pytest( 236s ["--inline-snapshot=update"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s import attrs 236s 236s @attrs.define 236s class A: 236s a:int 236s b:int=2 236s c:list=attrs.field(factory=list) 236s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1)) 236s assert A(a=2,b=3) == snapshot(A(a=2,b=3)) 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:139: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E AssertionError: assert {'test_someth...=[],d=11))\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 236s E 'import attrs\n' 236s E '\n' 236s E '@attrs.define\n' 236s E 'class A:\n'... 236s E 236s E ...Full output truncated (11 lines hidden), use '-vv' to show 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s import attrs 236s 236s @attrs.define 236s class A: 236s a:int 236s b:int=2 236s c:list=attrs.field(factory=list) 236s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 236s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpy7dr8ot3 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_something ________________________________ 236s 236s def test_something(): 236s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 236s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 236s 236s test_something.py:13: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmpy7dr8ot3/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 236s ============================== 1 failed in 0.17s =============================== 236s 236s stderr: 236s 236s ____________________________ test_attrs_field_repr _____________________________ 236s 236s def test_attrs_field_repr(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s import attrs 236s 236s @attrs.define 236s class container: 236s a: int 236s b: int = attrs.field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot() 236s """ 236s > ).run_pytest( 236s ["--inline-snapshot=create"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s import attrs 236s 236s @attrs.define 236s class container: 236s a: int 236s b: int = attrs.field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot(container(a=1)) 236s """ 236s } 236s ), 236s ).run_pytest() 236s 236s tests/adapter/test_dataclass.py:198: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=create'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_something.py': 'from inline_snapshot import snapshot\n' 236s E 'import attrs\n' 236s E '\n' 236s E '@attrs.define\n' 236s E 'class container:\n'... 236s E 236s E ...Full output truncated (5 lines hidden), use '-vv' to show 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s import attrs 236s 236s @attrs.define 236s class container: 236s a: int 236s b: int = attrs.field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot() 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmp7jwfv83i 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 0 items / 1 error 236s 236s ==================================== ERRORS ==================================== 236s ______________________ ERROR collecting test_something.py ______________________ 236s test_something.py:9: in 236s assert container(a=1,b=5) == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 236s runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 236s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 236s =============================== 1 error in 0.25s =============================== 236s 236s stderr: 236s 236s ___________________________ test_disabled[executing] ___________________________ 236s 236s executing_used = True 236s 236s def test_disabled(executing_used): 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s 236s def test_something(): 236s assert A(a=3) == snapshot(A(a=5)),"not equal" 236s """ 236s > ).run_inline( 236s changed_files=snapshot({}), 236s raises=snapshot( 236s """\ 236s AssertionError: 236s not equal\ 236s """ 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:261: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 236s assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/adapter/test_dataclass.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s 236s def test_something(): 236s assert A(a=3) == snapshot(A(a=5)),"not equal" 236s 236s 236s run> pytest /tmp/tmpyea73l9r/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpyea73l9r/test_something.py", line 9, in test_something 236s assert A(a=3) == snapshot(A(a=5)),"not equal" 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _______________________ test_disabled[without-executing] _______________________ 236s 236s executing_used = False 236s 236s def test_disabled(executing_used): 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s 236s def test_something(): 236s assert A(a=3) == snapshot(A(a=5)),"not equal" 236s """ 236s > ).run_inline( 236s changed_files=snapshot({}), 236s raises=snapshot( 236s """\ 236s AssertionError: 236s not equal\ 236s """ 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:261: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 236s assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:53: in assign 236s and self.context.file._token_of_node(old_node) != new_token 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s node = 236s 236s def _token_of_node(self, node): 236s 236s return list( 236s normalize( 236s [ 236s simple_token(t.type, t.string) 236s > for t in self._source.asttokens().get_tokens(node) 236s if t.type not in ignore_tokens 236s ] 236s ) 236s ) 236s E AttributeError: 'NoneType' object has no attribute 'asttokens' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:45: AttributeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int 236s 236s def test_something(): 236s assert A(a=3) == snapshot(A(a=5)),"not equal" 236s 236s 236s run> pytest /tmp/tmpizz0ytaz/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpizz0ytaz/test_something.py", line 9, in test_something 236s assert A(a=3) == snapshot(A(a=5)),"not equal" 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s AssertionError: not equal 236s ______________________________ test_add_argument _______________________________ 236s 236s def test_add_argument(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int=0 236s b:int=0 236s c:int=0 236s 236s def test_something(): 236s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int=0 236s b:int=0 236s c:int=0 236s 236s def test_something(): 236s assert A(a=3,b=3,c=3) == snapshot(A(a = 3, b=3, c = 3)),"not equal" 236s """ 236s } 236s ), 236s raises=snapshot(None), 236s ) 236s 236s tests/adapter/test_dataclass.py:322: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 236s assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/adapter/test_dataclass.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass 236s 236s @dataclass 236s class A: 236s a:int=0 236s b:int=0 236s c:int=0 236s 236s def test_something(): 236s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 236s 236s 236s run> pytest /tmp/tmp02k8yj_u/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmp02k8yj_u/test_something.py", line 11, in test_something 236s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 207, in assign 236s new_code=self.context.file._value_to_code(value), 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 37, in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _______________________ test_remove_positional_argument ________________________ 236s 236s def test_remove_positional_argument(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s 236s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 236s 236s 236s class L: 236s def __init__(self,*l): 236s self.l=l 236s 236s def __eq__(self,other): 236s if not isinstance(other,L): 236s return NotImplemented 236s return other.l==self.l 236s 236s class LAdapter(GenericCallAdapter): 236s @classmethod 236s def check_type(cls, typ): 236s return issubclass(typ,L) 236s 236s @classmethod 236s def arguments(cls, value): 236s return ([Argument(x) for x in value.l],{}) 236s 236s @classmethod 236s def argument(cls, value, pos_or_name): 236s assert isinstance(pos_or_name,int) 236s return value.l[pos_or_name] 236s 236s def test_L1(): 236s assert L(1,2) == snapshot(L(1)), "not equal" 236s 236s def test_L2(): 236s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 236s """ 236s > ).run_pytest( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s 236s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 236s 236s 236s class L: 236s def __init__(self,*l): 236s self.l=l 236s 236s def __eq__(self,other): 236s if not isinstance(other,L): 236s return NotImplemented 236s return other.l==self.l 236s 236s class LAdapter(GenericCallAdapter): 236s @classmethod 236s def check_type(cls, typ): 236s return issubclass(typ,L) 236s 236s @classmethod 236s def arguments(cls, value): 236s return ([Argument(x) for x in value.l],{}) 236s 236s @classmethod 236s def argument(cls, value, pos_or_name): 236s assert isinstance(pos_or_name,int) 236s return value.l[pos_or_name] 236s 236s def test_L1(): 236s assert L(1,2) == snapshot(L(1, 2)), "not equal" 236s 236s def test_L2(): 236s assert L(1,2) == snapshot(L(1, 2)), "not equal" 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:408: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E assert {'test_someth...not equal"\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_something.py': 'from inline_snapshot import snapshot\n' 236s E '\n' 236s E 'from inline_snapshot._adapter.generic_call_adapter ' 236s E 'import GenericCallAdapter,Argument\n' 236s E '\n'... 236s E 236s E ...Full output truncated (30 lines hidden), use '-vv' to show 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s 236s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 236s 236s 236s class L: 236s def __init__(self,*l): 236s self.l=l 236s 236s def __eq__(self,other): 236s if not isinstance(other,L): 236s return NotImplemented 236s return other.l==self.l 236s 236s class LAdapter(GenericCallAdapter): 236s @classmethod 236s def check_type(cls, typ): 236s return issubclass(typ,L) 236s 236s @classmethod 236s def arguments(cls, value): 236s return ([Argument(x) for x in value.l],{}) 236s 236s @classmethod 236s def argument(cls, value, pos_or_name): 236s assert isinstance(pos_or_name,int) 236s return value.l[pos_or_name] 236s 236s def test_L1(): 236s assert L(1,2) == snapshot(L(1)), "not equal" 236s 236s def test_L2(): 236s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpl25feuk6 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 2 items 236s 236s test_something.py F. [100%] 236s 236s =================================== FAILURES =================================== 236s ___________________________________ test_L1 ____________________________________ 236s 236s def test_L1(): 236s > assert L(1,2) == snapshot(L(1)), "not equal" 236s 236s test_something.py:30: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 236s new_code=self.context.file._value_to_code(value.value), 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmpl25feuk6/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s ──────────────────────────────── Fix snapshots ───────────────────────────────── 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 236s diff = file.diff() 236s ^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 236s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 236s ^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s ^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _______________________________ test_namedtuple ________________________________ 236s 236s def test_namedtuple(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from collections import namedtuple 236s 236s T=namedtuple("T","a,b") 236s 236s def test_tuple(): 236s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 236s """ 236s > ).run_pytest( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s from collections import namedtuple 236s 236s T=namedtuple("T","a,b") 236s 236s def test_tuple(): 236s assert T(a=1,b=2) == snapshot(T(a=1, b=2)), "not equal" 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:463: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E assert {'test_someth...not equal"\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_something.py': 'from inline_snapshot import snapshot\n' 236s E 'from collections import namedtuple\n' 236s E '\n' 236s E 'T=namedtuple("T","a,b")\n' 236s E '\n'... 236s E 236s E ...Full output truncated (4 lines hidden), use '-vv' to show 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from collections import namedtuple 236s 236s T=namedtuple("T","a,b") 236s 236s def test_tuple(): 236s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmplgnnk3di 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s __________________________________ test_tuple __________________________________ 236s 236s def test_tuple(): 236s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 236s 236s test_something.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 236s result_kwargs[key] = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmplgnnk3di/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 236s ============================== 1 failed in 0.20s =============================== 236s 236s stderr: 236s 236s _______________________________ test_defaultdict _______________________________ 236s 236s def test_defaultdict(): 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from collections import defaultdict 236s 236s 236s def test_tuple(): 236s d=defaultdict(list) 236s d[1].append(2) 236s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 236s """ 236s > ).run_pytest( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s from collections import defaultdict 236s 236s 236s def test_tuple(): 236s d=defaultdict(list) 236s d[1].append(2) 236s assert d == snapshot(defaultdict(list, {1: [2]})), "not equal" 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:493: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E assert {'test_someth...not equal"\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_something.py': 'from inline_snapshot import snapshot\n' 236s E 'from collections import defaultdict\n' 236s E '\n' 236s E '\n' 236s E 'def test_tuple():\n'... 236s E 236s E ...Full output truncated (5 lines hidden), use '-vv' to show 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from collections import defaultdict 236s 236s 236s def test_tuple(): 236s d=defaultdict(list) 236s d[1].append(2) 236s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpgl9avv77 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s __________________________________ test_tuple __________________________________ 236s 236s def test_tuple(): 236s d=defaultdict(list) 236s d[1].append(2) 236s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 236s 236s test_something.py:8: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 236s result = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 236s result[key] = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 236s v = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '2 ', filename = PosixPath('/tmp/tmpgl9avv77/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 236s ============================== 1 failed in 0.24s =============================== 236s 236s stderr: 236s 236s __________________________ test_dataclass_field_repr ___________________________ 236s 236s def test_dataclass_field_repr(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class container: 236s a: int 236s b: int = field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot() 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=create"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class container: 236s a: int 236s b: int = field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot(container(a=1)) 236s """ 236s } 236s ), 236s ).run_inline() 236s 236s tests/adapter/test_dataclass.py:526: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=create'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class container: 236s a: int 236s b: int = field(default=5,repr=False) 236s 236s assert container(a=1,b=5) == snapshot() 236s 236s 236s run> pytest /tmp/tmp6ead5nud/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 236s exec( 236s File "/tmp/tmp6ead5nud/test_something.py", line 9, in 236s assert container(a=1,b=5) == snapshot() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ______________________________ test_dataclass_var ______________________________ 236s 236s def test_dataclass_var(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class container: 236s a: int 236s 236s def test_list(): 236s l=container(5) 236s assert l == snapshot(l), "not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=update"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class container: 236s a: int 236s 236s def test_list(): 236s l=container(5) 236s assert l == snapshot(container(a=5)), "not equal" 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dataclass.py:561: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=update'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s from dataclasses import dataclass,field 236s 236s @dataclass 236s class container: 236s a: int 236s 236s def test_list(): 236s l=container(5) 236s assert l == snapshot(l), "not equal" 236s 236s 236s run> pytest /tmp/tmppk5yyhjt/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmppk5yyhjt/test_something.py", line 10, in test_list 236s assert l == snapshot(l), "not equal" 236s ^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 101, in assign 236s result = yield from self.value_assign(old_value, old_node, new_value) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 236s result = yield from adapter.assign(old_value, old_node, new_value) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ________________________________ test_dict_var _________________________________ 236s 236s def test_dict_var(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s 236s def test_list(): 236s l={1:2} 236s assert l == snapshot(l), "not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=update"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s 236s def test_list(): 236s l={1:2} 236s assert l == snapshot({1: 2}), "not equal" 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_dict.py:15: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=update'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s 236s def test_list(): 236s l={1:2} 236s assert l == snapshot(l), "not equal" 236s 236s 236s run> pytest /tmp/tmpzjhub69q/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpzjhub69q/test_something.py", line 5, in test_list 236s assert l == snapshot(l), "not equal" 236s ^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py", line 62, in assign 236s result = yield from self.value_assign(old_value, old_node, new_value) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 236s result = yield from adapter.assign(old_value, old_node, new_value) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ____________________________ test_adapter_mismatch _____________________________ 236s 236s def test_adapter_mismatch(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s 236s 236s def test_thing(): 236s assert [1,2] == snapshot({1:2}) 236s 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s 236s 236s def test_thing(): 236s assert [1,2] == snapshot([1, 2]) 236s 236s \ 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_general.py:16: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s 236s 236s def test_thing(): 236s assert [1,2] == snapshot({1:2}) 236s 236s 236s 236s run> pytest /tmp/tmp5zbv0a7e/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmp5zbv0a7e/test_something.py", line 5, in test_thing 236s assert [1,2] == snapshot({1:2}) 236s ^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ___________________ test_list_adapter_create_inner_snapshot ____________________ 236s 236s def test_list_adapter_create_inner_snapshot(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from dirty_equals import IsInt 236s 236s def test_list(): 236s 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=create"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s from dirty_equals import IsInt 236s 236s def test_list(): 236s 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 236s """ 236s } 236s ), 236s raises=snapshot(None), 236s ) 236s 236s tests/adapter/test_sequence.py:17: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 236s assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/adapter/test_sequence.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from dirty_equals import IsInt 236s 236s def test_list(): 236s 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 236s 236s 236s run> pytest /tmp/tmpcv238m_j/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpcv238m_j/test_something.py", line 6, in test_list 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 236s return _return(self._visible_value() == other) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 236s return self.value == other 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _____________________ test_list_adapter_fix_inner_snapshot _____________________ 236s 236s def test_list_adapter_fix_inner_snapshot(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s from dirty_equals import IsInt 236s 236s def test_list(): 236s 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s from dirty_equals import IsInt 236s 236s def test_list(): 236s 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 236s """ 236s } 236s ), 236s raises=snapshot(None), 236s ) 236s 236s tests/adapter/test_sequence.py:46: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 236s assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/adapter/test_sequence.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s from dirty_equals import IsInt 236s 236s def test_list(): 236s 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 236s 236s 236s run> pytest /tmp/tmpwmtzlitd/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpwmtzlitd/test_something.py", line 6, in test_list 236s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 236s return _return(self._visible_value() == other) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 236s return self.value == other 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ________________________________ test_list_var _________________________________ 236s 236s def test_list_var(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot,Is 236s 236s def test_list(): 236s l=[1] 236s assert l == snapshot(l), "not equal" 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=update"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot,Is 236s 236s def test_list(): 236s l=[1] 236s assert l == snapshot([1]), "not equal" 236s """ 236s } 236s ), 236s ) 236s 236s tests/adapter/test_sequence.py:92: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=update'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot,Is 236s 236s def test_list(): 236s l=[1] 236s assert l == snapshot(l), "not equal" 236s 236s 236s run> pytest /tmp/tmpee_k77wb/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpee_k77wb/test_something.py", line 5, in test_list 236s assert l == snapshot(l), "not equal" 236s ^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 52, in assign 236s result = yield from self.value_assign(old_value, old_node, new_value) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 236s result = yield from adapter.assign(old_value, old_node, new_value) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s __________________________ test_change_function_args ___________________________ 236s 236s check_change = .w at 0x3ff8e2919e0> 236s 236s def test_change_function_args(check_change): 236s 236s > check_change( 236s "f(a,b=2)", 236s lambda source, call: [ 236s Replace( 236s flag="fix", 236s file=source, 236s node=call.args[0], 236s new_code="22", 236s old_value=0, 236s new_value=0, 236s ) 236s ], 236s snapshot("f(22,b=2)"), 236s ) 236s 236s tests/test_change.py:48: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/test_change.py:37: in w 236s cr.virtual_write() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:244: in virtual_write 236s file.virtual_write() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:141: in virtual_write 236s self.source = self.new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = 'f(a,b=2)' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_change_function_args0/test_0.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s test: f(a,b=2) 236s __________________________________ test_enum ___________________________________ 236s 236s check_update = .w at 0x3ff8e2913a0> 236s 236s def test_enum(check_update): 236s 236s assert ( 236s > check_update( 236s """ 236s from enum import Enum 236s 236s class color(Enum): 236s val="val" 236s 236s 236s assert [color.val] == snapshot() 236s 236s """, 236s flags="create", 236s ) 236s == snapshot( 236s """\ 236s 236s from enum import Enum 236s 236s class color(Enum): 236s val="val" 236s 236s 236s assert [color.val] == snapshot([color.val]) 236s 236s """ 236s ) 236s ) 236s 236s tests/test_code_repr.py:15: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:49: in w 236s s = source(source_code) 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py:16: in 236s assert [color.val] == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s | 236s |from enum import Enum 236s | 236s |class color(Enum): 236s | val="val" 236s | 236s | 236s |assert [color.val] == snapshot() 236s | 236s _______________________ test_snapshot_generates_hasrepr ________________________ 236s 236s def test_snapshot_generates_hasrepr(): 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s 236s class Thing: 236s def __repr__(self): 236s return "" 236s 236s def __eq__(self,other): 236s if not isinstance(other,Thing): 236s return NotImplemented 236s return True 236s 236s def test_thing(): 236s assert Thing() == snapshot() 236s 236s """ 236s > ).run_pytest( 236s ["--inline-snapshot=create"], 236s returncode=snapshot(0), 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s 236s from inline_snapshot import HasRepr 236s 236s class Thing: 236s def __repr__(self): 236s return "" 236s 236s def __eq__(self,other): 236s if not isinstance(other,Thing): 236s return NotImplemented 236s return True 236s 236s def test_thing(): 236s assert Thing() == snapshot(HasRepr(Thing, "")) 236s 236s \ 236s """ 236s } 236s ), 236s ).run_pytest( 236s ["--inline-snapshot=disable"], returncode=0 236s ).run_pytest( 236s returncode=0 236s ) 236s 236s tests/test_code_repr.py:63: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: in run_pytest 236s assert result.returncode == returncode 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_code_repr.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s 236s class Thing: 236s def __repr__(self): 236s return "" 236s 236s def __eq__(self,other): 236s if not isinstance(other,Thing): 236s return NotImplemented 236s return True 236s 236s def test_thing(): 236s assert Thing() == snapshot() 236s 236s 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmp2bxv8u57 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py F [100%] 236s 236s =================================== FAILURES =================================== 236s __________________________________ test_thing __________________________________ 236s 236s def test_thing(): 236s > assert Thing() == snapshot() 236s 236s test_something.py:13: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '', filename = PosixPath('/tmp/tmp2bxv8u57/test_something.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_something.py::test_thing - TypeError: CliRunner.__init__() got an... 236s ============================== 1 failed in 0.21s =============================== 236s 236s stderr: 236s 236s ____________________________ test_enum_in_dataclass ____________________________ 236s 236s check_update = .w at 0x3ff8e291120> 236s 236s def test_enum_in_dataclass(check_update): 236s 236s assert ( 236s > check_update( 236s """ 236s from enum import Enum 236s from dataclasses import dataclass 236s 236s class color(Enum): 236s red="red" 236s blue="blue" 236s 236s @dataclass 236s class container: 236s bg: color=color.red 236s fg: color=color.blue 236s 236s assert container(bg=color.red,fg=color.red) == snapshot() 236s 236s """, 236s flags="create", 236s ) 236s == snapshot( 236s """\ 236s 236s from enum import Enum 236s from dataclasses import dataclass 236s 236s class color(Enum): 236s red="red" 236s blue="blue" 236s 236s @dataclass 236s class container: 236s bg: color=color.red 236s fg: color=color.blue 236s 236s assert container(bg=color.red,fg=color.red) == snapshot(container(fg=color.red)) 236s 236s """ 236s ) 236s ) 236s 236s tests/test_code_repr.py:106: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:49: in w 236s s = source(source_code) 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py:22: in 236s assert container(bg=color.red,fg=color.red) == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s | 236s |from enum import Enum 236s |from dataclasses import dataclass 236s | 236s |class color(Enum): 236s | red="red" 236s | blue="blue" 236s | 236s |@dataclass 236s |class container: 236s | bg: color=color.red 236s | fg: color=color.blue 236s | 236s |assert container(bg=color.red,fg=color.red) == snapshot() 236s | 236s __________________________________ test_flag ___________________________________ 236s 236s check_update = .w at 0x3ff8e291c60> 236s 236s def test_flag(check_update): 236s 236s assert ( 236s > check_update( 236s """ 236s from enum import Flag, auto 236s 236s class Color(Flag): 236s red = auto() 236s green = auto() 236s blue = auto() 236s 236s assert Color.red | Color.blue == snapshot() 236s 236s """, 236s flags="create", 236s ) 236s == snapshot( 236s """\ 236s 236s from enum import Flag, auto 236s 236s class Color(Flag): 236s red = auto() 236s green = auto() 236s blue = auto() 236s 236s assert Color.red | Color.blue == snapshot(Color.red | Color.blue) 236s 236s """ 236s ) 236s ) 236s 236s tests/test_code_repr.py:150: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:49: in w 236s s = source(source_code) 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py:17: in 236s assert Color.red | Color.blue == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s | 236s |from enum import Flag, auto 236s | 236s |class Color(Flag): 236s | red = auto() 236s | green = auto() 236s | blue = auto() 236s | 236s |assert Color.red | Color.blue == snapshot() 236s | 236s __________________________________ test_type ___________________________________ 236s 236s check_update = .w at 0x3ff8e2925c0> 236s 236s def test_type(check_update): 236s 236s assert ( 236s > check_update( 236s """\ 236s class Color: 236s pass 236s 236s assert [Color,int] == snapshot() 236s 236s """, 236s flags="create", 236s ) 236s == snapshot( 236s """\ 236s class Color: 236s pass 236s 236s assert [Color,int] == snapshot([Color, int]) 236s 236s """ 236s ) 236s ) 236s 236s tests/test_code_repr.py:184: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:49: in w 236s s = source(source_code) 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py:12: in 236s assert [Color,int] == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |class Color: 236s | pass 236s | 236s |assert [Color,int] == snapshot() 236s | 236s ________________________________ test_qualname _________________________________ 236s 236s def test_qualname(): 236s 236s Example( 236s """\ 236s from enum import Enum 236s from inline_snapshot import snapshot 236s 236s 236s class Namespace: 236s class Color(Enum): 236s red="red" 236s 236s assert Namespace.Color.red == snapshot() 236s 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=create"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from enum import Enum 236s from inline_snapshot import snapshot 236s 236s 236s class Namespace: 236s class Color(Enum): 236s red="red" 236s 236s assert Namespace.Color.red == snapshot(Namespace.Color.red) 236s 236s \ 236s """ 236s } 236s ), 236s ).run_inline() 236s 236s tests/test_code_repr.py:221: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=create'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from enum import Enum 236s from inline_snapshot import snapshot 236s 236s 236s class Namespace: 236s class Color(Enum): 236s red="red" 236s 236s assert Namespace.Color.red == snapshot() 236s 236s 236s 236s run> pytest /tmp/tmp3nd50txe/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 236s exec( 236s File "/tmp/tmp3nd50txe/test_something.py", line 9, in 236s assert Namespace.Color.red == snapshot() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s ______________________________ test_invalid_repr _______________________________ 236s 236s check_update = .w at 0x3ff8e0d2fc0> 236s 236s def test_invalid_repr(check_update): 236s assert ( 236s > check_update( 236s """\ 236s class Thing: 236s def __repr__(self): 236s return "+++" 236s 236s def __eq__(self,other): 236s if not isinstance(other,Thing): 236s return NotImplemented 236s return True 236s 236s assert Thing() == snapshot() 236s """, 236s flags="create", 236s ) 236s == snapshot( 236s """\ 236s class Thing: 236s def __repr__(self): 236s return "+++" 236s 236s def __eq__(self,other): 236s if not isinstance(other,Thing): 236s return NotImplemented 236s return True 236s 236s assert Thing() == snapshot(HasRepr(Thing, "+++")) 236s """ 236s ) 236s ) 236s 236s tests/test_code_repr.py:351: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:49: in w 236s s = source(source_code) 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py:18: in 236s assert Thing() == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |class Thing: 236s | def __repr__(self): 236s | return "+++" 236s | 236s | def __eq__(self,other): 236s | if not isinstance(other,Thing): 236s | return NotImplemented 236s | return True 236s | 236s |assert Thing() == snapshot() 236s ____________________________ test_config_pyproject _____________________________ 236s 236s def test_config_pyproject(): 236s 236s Example( 236s { 236s **file_to_trim, 236s "pyproject.toml": """ 236s [tool.inline-snapshot] 236s default-flags = ["trim"] 236s """, 236s } 236s > ).run_pytest(changed_files=trimmed_files) 236s 236s tests/test_config.py:37: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = [] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_a.py': 'from inline_snapshot import snapshot\n' 236s E '\n' 236s E 'def test_a():\n' 236s E ' assert 1 <= snapshot(1)\n' 236s E ' assert 1 == snapshot(2)\n'} 236s E Use -v to get more diff 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s file: pyproject.toml 236s 236s [tool.inline-snapshot] 236s default-flags = ["trim"] 236s 236s 236s run> /usr/bin/python3.12 -m pytest 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpwk64vx64 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpwk64vx64/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _______________________________ test_config_env ________________________________ 236s 236s def test_config_env(): 236s > Example(file_to_trim).run_pytest( 236s env={"INLINE_SNAPSHOT_DEFAULT_FLAGS": "trim"}, changed_files=trimmed_files 236s ) 236s 236s tests/test_config.py:41: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = [] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_a.py': 'from inline_snapshot import snapshot\n' 236s E '\n' 236s E 'def test_a():\n' 236s E ' assert 1 <= snapshot(1)\n' 236s E ' assert 1 == snapshot(2)\n'} 236s E Use -v to get more diff 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s run> /usr/bin/python3.12 -m pytest 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpxopo7dro 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpxopo7dro/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s ________________________________ test_shortcuts ________________________________ 236s 236s def test_shortcuts(): 236s 236s Example( 236s { 236s **file_to_trim, 236s "pyproject.toml": """ 236s [tool.inline-snapshot.shortcuts] 236s strim=["trim"] 236s """, 236s } 236s > ).run_pytest(["--strim"], changed_files=trimmed_files) 236s 236s tests/test_config.py:56: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--strim'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_a.py': 'from inline_snapshot import snapshot\n' 236s E '\n' 236s E 'def test_a():\n' 236s E ' assert 1 <= snapshot(1)\n' 236s E ' assert 1 == snapshot(2)\n'} 236s E Use -v to get more diff 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s file: pyproject.toml 236s 236s [tool.inline-snapshot.shortcuts] 236s strim=["trim"] 236s 236s 236s run> /usr/bin/python3.12 -m pytest --strim 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpm6vbo6c5 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpm6vbo6c5/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s ____________________________ test_default_shortcuts ____________________________ 236s 236s def test_default_shortcuts(): 236s 236s Example( 236s { 236s **file_to_trim, 236s "pyproject.toml": """ 236s """, 236s } 236s > ).run_pytest( 236s ["--fix"], 236s changed_files=snapshot( 236s { 236s "test_a.py": """\ 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(1) 236s """ 236s } 236s ), 236s ) 236s 236s tests/test_config.py:67: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--fix'] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s assert result.returncode == returncode 236s 236s if stderr is not None: 236s assert result.stderr.decode() == stderr 236s 236s if report is not None: 236s 236s report_list = [] 236s record = False 236s for line in result.stdout.decode().splitlines(): 236s line = line.strip() 236s if line.startswith("===="): 236s record = False 236s 236s if record and line: 236s report_list.append(line) 236s 236s if line.startswith("====") and "inline snapshot" in line: 236s record = True 236s 236s report_str = "\n".join(report_list) 236s 236s assert normalize(report_str) == report, repr(report_str) 236s 236s if changed_files is not None: 236s current_files = {} 236s 236s for name, content in sorted(self._read_files(tmp_path).items()): 236s if name not in self.files or self.files[name] != content: 236s current_files[name] = content 236s > assert changed_files == current_files 236s E AssertionError: assert {'test_a.py':...napshot(1)\n'} == {} 236s E 236s E Left contains 1 more item: 236s E {'test_a.py': 'from inline_snapshot import snapshot\n' 236s E '\n' 236s E 'def test_a():\n' 236s E ' assert 1 <= snapshot(5)\n' 236s E ' assert 1 == snapshot(1)\n'} 236s E Use -v to get more diff 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s assert 1 == snapshot(2) 236s 236s 236s file: pyproject.toml 236s 236s 236s 236s run> /usr/bin/python3.12 -m pytest --fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpdb9820i8 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert 1 <= snapshot(5) 236s > assert 1 == snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpdb9820i8/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _______________________ test_compare_dirty_equals_twice ________________________ 236s 236s def test_compare_dirty_equals_twice() -> None: 236s 236s Example( 236s """ 236s from dirty_equals import IsStr 236s from inline_snapshot import snapshot 236s 236s for x in 'ab': 236s assert x == snapshot(IsStr()) 236s assert [x,5] == snapshot([IsStr(),3]) 236s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 236s 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s 236s from dirty_equals import IsStr 236s from inline_snapshot import snapshot 236s 236s for x in 'ab': 236s assert x == snapshot(IsStr()) 236s assert [x,5] == snapshot([IsStr(),5]) 236s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':5}) 236s 236s """ 236s } 236s ), 236s ) 236s 236s tests/test_dirty_equals.py:47: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s 236s from dirty_equals import IsStr 236s from inline_snapshot import snapshot 236s 236s for x in 'ab': 236s assert x == snapshot(IsStr()) 236s assert [x,5] == snapshot([IsStr(),3]) 236s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 236s 236s 236s 236s run> pytest /tmp/tmpukh3_say/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 236s exec( 236s File "/tmp/tmpukh3_say/test_something.py", line 7, in 236s assert [x,5] == snapshot([IsStr(),3]) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 236s v = yield from self.get_adapter( 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _____________________ test_dirty_equals_with_changing_args _____________________ 236s 236s def test_dirty_equals_with_changing_args() -> None: 236s 236s Example( 236s """\ 236s from dirty_equals import IsInt 236s from inline_snapshot import snapshot 236s 236s def test_number(): 236s 236s for i in range(5): 236s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 236s 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from dirty_equals import IsInt 236s from inline_snapshot import snapshot 236s 236s def test_number(): 236s 236s for i in range(5): 236s assert ["a",i] == snapshot(["a",IsInt(gt=i-1,lt=i+1)]) 236s 236s """ 236s } 236s ), 236s ) 236s 236s tests/test_dirty_equals.py:138: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from dirty_equals import IsInt 236s from inline_snapshot import snapshot 236s 236s def test_number(): 236s 236s for i in range(5): 236s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 236s 236s 236s 236s run> pytest /tmp/tmpbzl9zi0y/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpbzl9zi0y/test_something.py", line 7, in test_number 236s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 236s v = yield from self.get_adapter( 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _________________________________ test_example _________________________________ 236s 236s def test_example(): 236s 236s e = Example( 236s { 236s "test_a.py": """ 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1==snapshot(2) 236s """, 236s "test_b.py": "1+1", 236s }, 236s ) 236s 236s e.run_pytest( 236s ["--inline-snapshot=create,fix"], 236s ) 236s 236s > e.run_inline( 236s ["--inline-snapshot=fix"], 236s reported_categories=snapshot(["fix"]), 236s ).run_inline( 236s ["--inline-snapshot=fix"], 236s changed_files=snapshot({}), 236s ) 236s 236s tests/test_example.py:23: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s > assert sorted(snapshot_flags) == reported_categories 236s E AssertionError: assert [] == ['fix'] 236s E 236s E Right contains one more item: 'fix' 236s E Use -v to get more diff 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:223: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_a.py 236s 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1==snapshot(2) 236s 236s 236s file: test_b.py 236s 1+1 236s 236s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmpv1ykmz0d 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_a.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert 1==snapshot(2) 236s 236s test_a.py:5: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '1 ', filename = PosixPath('/tmp/tmpv1ykmz0d/test_a.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 236s ============================== 1 failed in 0.20s =============================== 236s 236s stderr: 236s 236s file: test_b.py 236s 1+1 236s 236s file: test_a.py 236s 236s from inline_snapshot import snapshot 236s 236s def test_a(): 236s assert 1==snapshot(2) 236s 236s 236s run> pytest /tmp/tmpfqqgbz6q/test_b.py 236s run> pytest /tmp/tmpfqqgbz6q/test_a.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmpfqqgbz6q/test_a.py", line 5, in test_a 236s assert 1==snapshot(2) 236s ^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s __________________________________ test_basic __________________________________ 236s 236s check_update = .w at 0x3ff8e0d0180> 236s 236s def test_basic(check_update): 236s > assert check_update( 236s "assert outsource('text') == snapshot()", flags="create" 236s ) == snapshot( 236s "assert outsource('text') == snapshot(external(\"982d9e3eb996*.txt\"))" 236s ) 236s 236s tests/test_external.py:12: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:49: in w 236s s = source(source_code) 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py:9: in 236s assert outsource('text') == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert outsource('text') == snapshot() 236s _________________________________ test_persist _________________________________ 236s 236s project = .Project object at 0x3ff8dedec30> 236s 236s def test_persist(project): 236s 236s project.setup( 236s """\ 236s from inline_snapshot import external 236s 236s def test_something(): 236s assert "hello" == snapshot(external("bbbbb*.txt")) 236s assert 2 == snapshot(1+1) 236s """ 236s ) 236s 236s result = project.run("--inline-snapshot=update") 236s 236s assert project.storage() == snapshot([]) 236s 236s > assert project.source == snapshot( 236s """\ 236s from inline_snapshot import external 236s 236s def test_something(): 236s assert "hello" == snapshot(external("bbbbb*.txt")) 236s assert 2 == snapshot(2) 236s """ 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:78: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_something():\n assert "hello" == snapshot(external("bbbbb*.txt"))\n assert 2 == snapshot(1+1)\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s from inline_snapshot import external 236s 236s def test_something(): 236s assert "hello" == snapshot(external("bbbbb*.txt")) 236s assert 2 == snapshot(1+1) 236s 236s running: pytest --inline-snapshot=update 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_something ________________________________ 236s 236s def test_something(): 236s > assert "hello" == snapshot(external("bbbbb*.txt")) 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = "'hello'" 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 236s ============================== 1 failed in 0.25s =============================== 236s _________________________ test_pytest_compare_external _________________________ 236s 236s project = .Project object at 0x3ff8dc9a210> 236s 236s def test_pytest_compare_external(project): 236s project.setup( 236s """\ 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource("test") == snapshot( 236s external("9f86d081884c*.txt") 236s ) 236s 236s assert outsource("test2") == snapshot( 236s external("9f86d081884c*.txt") 236s ) 236s """ 236s ) 236s 236s result = project.run() 236s 236s > assert result.errorLines() == snapshot( 236s """\ 236s > assert outsource("test2") == snapshot( 236s E AssertionError: assert 'test2' == 'test' 236s E ⏎ 236s E - test 236s E + test2 236s E ? + 236s """ 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:123: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\n> assert outsource("test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource("test") == snapshot( 236s external("9f86d081884c*.txt") 236s ) 236s 236s assert outsource("test2") == snapshot( 236s external("9f86d081884c*.txt") 236s ) 236s 236s running: pytest 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert outsource("test") == snapshot( 236s external("9f86d081884c*.txt") 236s ) 236s 236s > assert outsource("test2") == snapshot( 236s external("9f86d081884c*.txt") 236s ) 236s 236s test_file.py:11: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = 'external ("60303ae22b99*.txt")' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.22s =============================== 236s ______________________ test_pytest_compare_external_bytes ______________________ 236s 236s project = .Project object at 0x3ff8dc9bf50> 236s 236s def test_pytest_compare_external_bytes(project): 236s project.setup( 236s """\ 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource(b"test") == snapshot( 236s external("9f86d081884c*.bin") 236s ) 236s 236s assert outsource(b"test2") == snapshot( 236s external("9f86d081884c*.bin") 236s ) 236s """ 236s ) 236s 236s result = project.run() 236s 236s > assert result.errorLines() == snapshot( 236s """\ 236s > assert outsource(b"test2") == snapshot( 236s E AssertionError: assert b'test2' == b'test' 236s E ⏎ 236s E Use -v to get more diff 236s """ 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:153: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s 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"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource(b"test") == snapshot( 236s external("9f86d081884c*.bin") 236s ) 236s 236s assert outsource(b"test2") == snapshot( 236s external("9f86d081884c*.bin") 236s ) 236s 236s running: pytest 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s assert outsource(b"test") == snapshot( 236s external("9f86d081884c*.bin") 236s ) 236s 236s > assert outsource(b"test2") == snapshot( 236s external("9f86d081884c*.bin") 236s ) 236s 236s test_file.py:11: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = 'external ("60303ae22b99*.bin")' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.29s =============================== 236s _____________________ test_pytest_existing_external_import _____________________ 236s 236s project = .Project object at 0x3ff8dc9b530> 236s 236s def test_pytest_existing_external_import(project): 236s project.setup( 236s """\ 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource("test") == snapshot() 236s """ 236s ) 236s 236s result = project.run("--inline-snapshot=create") 236s 236s > assert project.source == snapshot( 236s """\ 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 236s """ 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:175: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s from inline_snapshot import external 236s 236s def test_a(): 236s assert outsource("test") == snapshot() 236s 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.23s =============================== 236s __________________________ test_pytest_trim_external ___________________________ 236s 236s project = .Project object at 0x3ff8dcaf020> 236s 236s def test_pytest_trim_external(project): 236s project.setup( 236s """\ 236s def test_a(): 236s assert outsource("test") == snapshot() 236s 236s # split 236s 236s assert outsource("test2") == snapshot() 236s """ 236s ) 236s 236s project.run("--inline-snapshot=create") 236s 236s > assert project.storage() == snapshot( 236s [ 236s "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.txt", 236s "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt", 236s ] 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:199: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 236s new_code = self.context.file._value_to_code(new_value_element) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s 236s 236s def test_a(): 236s assert outsource("test") == snapshot() 236s 236s # split 236s 236s assert outsource("test2") == snapshot() 236s 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.41s =============================== 236s ___________________________ test_pytest_new_external ___________________________ 236s 236s project = .Project object at 0x3ff8dcaeea0> 236s 236s def test_pytest_new_external(project): 236s project.setup( 236s """\ 236s def test_a(): 236s assert outsource("test") == snapshot() 236s """ 236s ) 236s project.run() 236s 236s assert project.storage() == snapshot( 236s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt"] 236s ) 236s 236s project.run("--inline-snapshot=create") 236s 236s > assert project.storage() == snapshot( 236s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt"] 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:255: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 236s v = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s 236s 236s def test_a(): 236s assert outsource("test") == snapshot() 236s 236s running: pytest 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py FE [100%] 236s 236s ==================================== ERRORS ==================================== 236s _________________________ ERROR at teardown of test_a __________________________ 236s your snapshot is missing one value. 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 236s ========================== 1 failed, 1 error in 0.25s ========================== 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.21s =============================== 236s ________________________ test_pytest_config_hash_length ________________________ 236s 236s project = .Project object at 0x3ff8dd07800> 236s 236s def test_pytest_config_hash_length(project): 236s project.setup( 236s """\ 236s def test_a(): 236s assert outsource("test") == snapshot() 236s """ 236s ) 236s project.run("--inline-snapshot=create") 236s default_result = project.source 236s 236s # default config 236s project.pyproject( 236s """ 236s [tool.inline-snapshot] 236s """ 236s ) 236s project.run("--inline-snapshot=create") 236s assert default_result == project.source 236s 236s # set hash_length 236s project.pyproject( 236s """ 236s [tool.inline-snapshot] 236s hash-length=5 236s """ 236s ) 236s project.run("--inline-snapshot=create") 236s > assert project.source == snapshot( 236s """\ 236s from inline_snapshot import external 236s 236s 236s def test_a(): 236s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 236s """ 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:287: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '"""\\\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s 236s 236s def test_a(): 236s assert outsource("test") == snapshot() 236s 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.21s =============================== 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.20s =============================== 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 236s configfile: pyproject.toml 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ____________________________________ test_a ____________________________________ 236s 236s def test_a(): 236s > assert outsource("test") == snapshot() 236s 236s test_file.py:7: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 236s ============================== 1 failed in 0.22s =============================== 236s _______________________________ test_no_imports ________________________________ 236s 236s project = .Project object at 0x3ff8dda07a0> 236s 236s def test_no_imports(project): 236s project.setup( 236s """\ 236s # no imports 236s 236s def test_something(): 236s from inline_snapshot import outsource,snapshot 236s assert outsource("test") == snapshot() 236s test_something() 236s """ 236s ) 236s 236s result = project.run("--inline-snapshot=create") 236s 236s > result.assert_outcomes(passed=1) 236s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 236s E 236s E Omitting 4 identical items, use -vv to show 236s E Differing items: 236s E {'passed': 0} != {'passed': 1} 236s E {'errors': 1} != {'errors': 0} 236s E Use -v to get more diff 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:340: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s 236s 236s # no imports 236s 236s def test_something(): 236s from inline_snapshot import outsource,snapshot 236s assert outsource("test") == snapshot() 236s test_something() 236s 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 0 items / 1 error 236s 236s ==================================== ERRORS ==================================== 236s ________________________ ERROR collecting test_file.py _________________________ 236s test_file.py:9: in 236s test_something() 236s test_file.py:8: in test_something 236s assert outsource("test") == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 236s runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 236s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 236s =============================== 1 error in 0.21s =============================== 236s _____________________________ test_ensure_imports ______________________________ 236s 236s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0') 236s 236s def test_ensure_imports(tmp_path): 236s file = tmp_path / "file.py" 236s file.write_text( 236s """\ 236s from os import environ 236s from os import getcwd 236s """, 236s "utf-8", 236s ) 236s 236s > with apply_changes(): 236s 236s tests/test_external.py:372: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3.12/contextlib.py:144: in __exit__ 236s next(self.gen) 236s tests/utils.py:32: in apply_changes 236s recorder.fix_all() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 236s file.rewrite() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 236s new_code = self.new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = 'from os import environ\nfrom os import getcwd\n' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0/file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s _______________________ test_ensure_imports_with_comment _______________________ 236s 236s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0') 236s 236s def test_ensure_imports_with_comment(tmp_path): 236s file = tmp_path / "file.py" 236s file.write_text( 236s """\ 236s from os import environ # comment 236s """, 236s "utf-8", 236s ) 236s 236s > with apply_changes(): 236s 236s tests/test_external.py:394: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3.12/contextlib.py:144: in __exit__ 236s next(self.gen) 236s tests/utils.py:32: in apply_changes 236s recorder.fix_all() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 236s file.rewrite() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 236s new_code = self.new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = 'from os import environ # comment\n' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0/file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ______________________________ test_new_externals ______________________________ 236s 236s project = .Project object at 0x3ff8dda3680> 236s 236s def test_new_externals(project): 236s project.setup( 236s """ 236s 236s def test_something(): 236s outsource("blub") 236s 236s assert outsource("foo") == snapshot() 236s 236s """ 236s ) 236s 236s project.run("--inline-snapshot=create") 236s 236s > assert project.storage() == snapshot( 236s [ 236s "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae.txt", 236s "8dc140e6fe831481a2005ae152ffe32a9974aa92a260dfbac780d6a87154bb0b-new.txt", 236s ] 236s ) 236s 236s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py:420: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 236s v = yield from self.get_adapter( 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = "'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae-new.txt'" 236s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_external.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s write code: 236s # äöß 🐍 236s from inline_snapshot import snapshot 236s from inline_snapshot import outsource 236s 236s 236s 236s 236s def test_something(): 236s outsource("blub") 236s 236s assert outsource("foo") == snapshot() 236s 236s 236s running: pytest --inline-snapshot=create 236s in: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 236s ============================= test session starts ============================== 236s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_file.py F [100%] 236s 236s =================================== FAILURES =================================== 236s ________________________________ test_something ________________________________ 236s 236s def test_something(): 236s outsource("blub") 236s 236s > assert outsource("foo") == snapshot() 236s 236s test_file.py:11: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_new_externals0/test_file.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s =============================== inline snapshot ================================ 236s =========================== short test summary info ============================ 236s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 236s ============================== 1 failed in 0.21s =============================== 236s _________________________ test_black_formatting_error __________________________ 236s 236s mocker = 236s 236s def test_black_formatting_error(mocker): 236s mocker.patch.object(CliRunner, "invoke", return_value=SimpleNamespace(exit_code=1)) 236s 236s Example( 236s """\ 236s from inline_snapshot import snapshot 236s 236s def test_something(): 236s assert 1==snapshot() 236s assert 1==snapshot(2) 236s assert list(range(20)) == snapshot() 236s """ 236s > ).run_inline( 236s ["--inline-snapshot=fix,create"], 236s changed_files=snapshot( 236s { 236s "test_something.py": """\ 236s from inline_snapshot import snapshot 236s 236s def test_something(): 236s assert 1==snapshot(1) 236s assert 1==snapshot(1) 236s 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 ]) 236s """ 236s } 236s ), 236s report=snapshot( 236s """\ 236s ----------------------------------- Problems ----------------------------------- 236s black could not format your code, which might be caused by this issue: 236s https://github.com/15r10nk/inline-snapshot/issues/138 236s 236s """ 236s ), 236s ) 236s 236s tests/test_formating.py:24: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = ['--inline-snapshot=fix,create'] 236s 236s def run_inline( 236s self, 236s args: list[str] = [], 236s *, 236s reported_categories: Snapshot[list[Category]] | None = None, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s raises: Snapshot[str] | None = None, 236s ) -> Example: 236s """Execute the example files in process and run every `test_*` 236s function. 236s 236s This is useful for fast test execution. 236s 236s Parameters: 236s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 236s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 236s changed_files: snapshot of files which are changed by this run. 236s raises: snapshot of the exception which is raised during the test execution. 236s It is required if your code raises an exception. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s parser = ArgumentParser() 236s 236s parser.add_argument( 236s "--inline-snapshot", 236s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 236s dest="inline_snapshot", 236s help="update specific snapshot values:\n" 236s "disable: disable the snapshot logic\n" 236s "short-report: show a short report\n" 236s "report: show a longer report with a diff report\n" 236s "review: allow to approve the changes interactive\n" 236s "create: creates snapshots which are currently not defined\n" 236s "update: update snapshots even if they are defined\n" 236s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 236s "fix: change snapshots which currently break your tests\n", 236s ) 236s parsed_args = parser.parse_args(args) 236s flags = (parsed_args.inline_snapshot or "").split(",") 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s 236s self._write_files(tmp_path) 236s 236s raised_exception = None 236s with snapshot_env(): 236s with ChangeRecorder().activate() as recorder: 236s _inline_snapshot._update_flags = Flags({*flags}) 236s inline_snapshot._external.storage = ( 236s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 236s ) 236s 236s try: 236s for filename in tmp_path.glob("*.py"): 236s globals: dict[str, Any] = {} 236s print("run> pytest", filename) 236s exec( 236s compile(filename.read_text("utf-8"), filename, "exec"), 236s globals, 236s ) 236s 236s # run all test_* functions 236s for k, v in globals.items(): 236s if k.startswith("test_") and callable(v): 236s v() 236s except Exception as e: 236s traceback.print_exc() 236s raised_exception = e 236s 236s finally: 236s _inline_snapshot._active = False 236s 236s changes = [] 236s for snapshot in _inline_snapshot.snapshots.values(): 236s changes += snapshot._changes() 236s 236s snapshot_flags = {change.flag for change in changes} 236s 236s apply_all( 236s [ 236s change 236s for change in changes 236s if change.flag in _inline_snapshot._update_flags.to_set() 236s ] 236s ) 236s recorder.fix_all() 236s 236s report_output = StringIO() 236s console = Console(file=report_output) 236s 236s # TODO: add all the report output here 236s report_problems(console) 236s 236s if reported_categories is not None: 236s assert sorted(snapshot_flags) == reported_categories 236s 236s if raised_exception is not None: 236s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 236s raised_exception 236s ) 236s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 236s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s from inline_snapshot import snapshot 236s 236s def test_something(): 236s assert 1==snapshot() 236s assert 1==snapshot(2) 236s assert list(range(20)) == snapshot() 236s 236s 236s run> pytest /tmp/tmprfwyfvmu/test_something.py 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 236s v() 236s File "/tmp/tmprfwyfvmu/test_something.py", line 4, in test_something 236s assert 1==snapshot() 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 236s return self == other 236s ^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 236s self._changes.append(next(it)) 236s ^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 236s new_code = self.context.file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s _______________________________ test_fstring_139 _______________________________ 236s 236s def test_fstring_139(): 236s Example( 236s """ 236s from inline_snapshot import snapshot 236s snapshot(f'') 236s snapshot(rf'') 236s snapshot(Rf'') 236s snapshot(F'') 236s snapshot(rF'') 236s snapshot(RF'') 236s 236s 236s def test_a(): 236s return None 236s """ 236s > ).run_pytest(returncode=0) 236s 236s tests/test_formating.py:64: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s self = 236s args = [] 236s 236s def run_pytest( 236s self, 236s args: list[str] = [], 236s *, 236s term_columns=80, 236s env: dict[str, str] = {}, 236s changed_files: Snapshot[dict[str, str]] | None = None, 236s report: Snapshot[str] | None = None, 236s stderr: Snapshot[str] | None = None, 236s returncode: Snapshot[int] | None = None, 236s ) -> Example: 236s """Run pytest with the given args and env variables in an seperate 236s process. 236s 236s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 236s 236s Parameters: 236s args: pytest arguments like "--inline-snapshot=fix" 236s env: dict of environment variables 236s changed_files: snapshot of files which are changed by this run. 236s report: snapshot of the report at the end of the pytest run. 236s stderr: pytest stderr output 236s returncode: snapshot of the pytest returncode. 236s 236s Returns: 236s A new Example instance which contains the changed files. 236s """ 236s 236s with TemporaryDirectory() as dir: 236s tmp_path = Path(dir) 236s self._write_files(tmp_path) 236s 236s cmd = [sys.executable, "-m", "pytest", *args] 236s 236s command_env = dict(os.environ) 236s command_env["TERM"] = "unknown" 236s command_env["COLUMNS"] = str( 236s term_columns + 1 if platform.system() == "Windows" else term_columns 236s ) 236s command_env.pop("CI", None) 236s 236s command_env.update(env) 236s 236s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 236s 236s print("run>", *cmd) 236s print("stdout:") 236s print(result.stdout.decode()) 236s print("stderr:") 236s print(result.stderr.decode()) 236s 236s if returncode is not None: 236s > assert result.returncode == returncode 236s E AssertionError: assert 1 == 0 236s 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 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: AssertionError 236s ----------------------------- Captured stdout call ----------------------------- 236s file: test_something.py 236s 236s from inline_snapshot import snapshot 236s snapshot(f'') 236s snapshot(rf'') 236s snapshot(Rf'') 236s snapshot(F'') 236s snapshot(rF'') 236s snapshot(RF'') 236s 236s 236s def test_a(): 236s return None 236s 236s 236s run> /usr/bin/python3.12 -m pytest 236s stdout: 236s ============================= test session starts ============================== 236s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 236s rootdir: /tmp/tmptbkkkz_6 236s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 236s collected 1 item 236s 236s test_something.py . [100%] 236s =============================== inline snapshot ================================ 236s 236s stderr: 236s Traceback (most recent call last): 236s File "", line 198, in _run_module_as_main 236s File "", line 88, in _run_code 236s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 236s raise SystemExit(pytest.console_main()) 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 236s code = main() 236s ^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 236s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 236s return wrap_session(config, _main) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 236s config.hook.pytest_sessionfinish( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 236s teardown.send(result) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 236s self.config.hook.pytest_terminal_summary( 236s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 236s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 236s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 236s raise exception.with_traceback(exception.__traceback__) 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 236s teardown.throw(exception) # type: ignore[union-attr] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 236s return (yield) 236s ^^^^^ 236s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 236s res = hook_impl.function(*args) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 236s for change in snapshot._changes(): 236s ^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 236s yield from self._value._get_changes() 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 218, in _get_changes 236s yield from handle(self._ast_node, self._old_value) 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 206, in handle 236s new_code = self._file._token_to_code(new_token) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 236s return format_code(text, Path(self._source.filename)) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 236s runner = CliRunner(mix_stderr=False) 236s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 236s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s _______________ test_generic[executing] [assert 4 == snapshot()] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py:9: in 236s assert 4 == snapshot() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 == snapshot() 236s ------------------------------ Captured log call ------------------------------- 236s 236s ____________ test_generic[executing] [assert 4 == snapshot({})[0]] _____________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py:9: in 236s assert 4 == snapshot({})[0] 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 == snapshot({})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ______________ test_generic[executing] [assert 4 == snapshot(5)] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py:9: in 236s assert 4 == snapshot(5) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 == snapshot(5) 236s ------------------------------ Captured log call ------------------------------- 236s 236s __________ test_generic[executing] [assert 4 == snapshot({0: 5})[0]] ___________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py:9: in 236s assert 4 == snapshot({0: 5})[0] 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 == snapshot({0: 5})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s _____________ test_generic[executing] [assert 4 == snapshot(2+2)] ______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py:9: in 236s assert 4 == snapshot(2+2) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 == snapshot(2+2) 236s ------------------------------ Captured log call ------------------------------- 236s 236s _________ test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] __________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py:9: in 236s assert 4 == snapshot({0: 2+2})[0] 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 == snapshot({0: 2+2})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s _______________ test_generic[executing] [assert 4 <= snapshot()] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 236s new_code = self._value._new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_7.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 <= snapshot() 236s ------------------------------ Captured log call ------------------------------- 236s 236s ____________ test_generic[executing] [assert 4 <= snapshot({})[0]] _____________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 236s to_insert.append((key, new_value_element._new_code())) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_8.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 <= snapshot({})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ______________ test_generic[executing] [assert 4 <= snapshot(5)] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_9.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 <= snapshot(5) 236s ------------------------------ Captured log call ------------------------------- 236s 236s __________ test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] ___________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_10.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 <= snapshot({0: 5})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ______________ test_generic[executing] [assert 5 <= snapshot(4)] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 <= snapshot(4) 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py", line 9, in 236s assert 5 <= snapshot(4) 236s ^^^^^^^^^^^^^^^^ 236s AssertionError 236s ------------------------------ Captured log call ------------------------------- 236s 236s __________ test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] ___________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 <= snapshot({0: 4})[0] 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py", line 9, in 236s assert 5 <= snapshot({0: 4})[0] 236s ^^^^^^^^^^^^^^^^^^^^^^^^ 236s AssertionError 236s ------------------------------ Captured log call ------------------------------- 236s 236s _____________ test_generic[executing] [assert 5 <= snapshot(3+2)] ______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_13.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 <= snapshot(3+2) 236s ------------------------------ Captured log call ------------------------------- 236s 236s _________ test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] __________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_14.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 <= snapshot({0: 3+2})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s _______________ test_generic[executing] [assert 5 >= snapshot()] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 236s new_code = self._value._new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_15.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 >= snapshot() 236s ------------------------------ Captured log call ------------------------------- 236s 236s ____________ test_generic[executing] [assert 5 >= snapshot({})[0]] _____________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 236s to_insert.append((key, new_value_element._new_code())) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_16.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 >= snapshot({})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ______________ test_generic[executing] [assert 5 >= snapshot(4)] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_17.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 >= snapshot(4) 236s ------------------------------ Captured log call ------------------------------- 236s 236s __________ test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] ___________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_18.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 >= snapshot({0: 4})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ______________ test_generic[executing] [assert 4 >= snapshot(5)] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 >= snapshot(5) 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py", line 9, in 236s assert 4 >= snapshot(5) 236s ^^^^^^^^^^^^^^^^ 236s AssertionError 236s ------------------------------ Captured log call ------------------------------- 236s 236s __________ test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] ___________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 4 >= snapshot({0: 5})[0] 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py", line 9, in 236s assert 4 >= snapshot({0: 5})[0] 236s ^^^^^^^^^^^^^^^^^^^^^^^^ 236s AssertionError 236s ------------------------------ Captured log call ------------------------------- 236s 236s _____________ test_generic[executing] [assert 5 >= snapshot(3+2)] ______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_21.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 >= snapshot(3+2) 236s ------------------------------ Captured log call ------------------------------- 236s 236s _________ test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] __________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_22.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 >= snapshot({0: 3+2})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s _______________ test_generic[executing] [assert 5 in snapshot()] _______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 236s new_code = self._value._new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '[5 ]' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_23.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot() 236s ------------------------------ Captured log call ------------------------------- 236s 236s ____________ test_generic[executing] [assert 5 in snapshot({})[0]] _____________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 236s to_insert.append((key, new_value_element._new_code())) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '[5 ]' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_24.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ____________ test_generic[executing] [assert 5 in snapshot([4, 5])] ____________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s s = source(code) 236s print("source:", code) 236s 236s if not executing_used and reported_flag == "update": 236s assert not s.flags 236s else: 236s assert list(s.flags) == [reported_flag] 236s 236s assert (reported_flag == "fix") == s.error 236s 236s for flag in all_flags: 236s if flag == reported_flag: 236s continue 236s print("use flag:", flag) 236s s2 = s.run(flag) 236s assert s2.source == s.source 236s 236s if not executing_used: 236s continue 236s 236s > s2 = s.run(reported_flag) 236s 236s tests/test_inline_snapshot.py:99: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:137: in run 236s recorder.fix_all() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 236s file.rewrite() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 236s new_code = self.new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s 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])' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_29.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([4, 5]) 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot= 236s output: 236s |assert 5 in snapshot([4, 5]) 236s source: assert 5 in snapshot([4, 5]) 236s use flag: fix 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([4, 5]) 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot=fix 236s output: 236s |assert 5 in snapshot([4, 5]) 236s use flag: create 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([4, 5]) 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot=create 236s output: 236s |assert 5 in snapshot([4, 5]) 236s use flag: update 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([4, 5]) 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot=update 236s output: 236s |assert 5 in snapshot([4, 5]) 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([4, 5]) 236s ------------------------------ Captured log call ------------------------------- 236s 236s ________ test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] ________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s s = source(code) 236s print("source:", code) 236s 236s if not executing_used and reported_flag == "update": 236s assert not s.flags 236s else: 236s assert list(s.flags) == [reported_flag] 236s 236s assert (reported_flag == "fix") == s.error 236s 236s for flag in all_flags: 236s if flag == reported_flag: 236s continue 236s print("use flag:", flag) 236s s2 = s.run(flag) 236s assert s2.source == s.source 236s 236s if not executing_used: 236s continue 236s 236s > s2 = s.run(reported_flag) 236s 236s tests/test_inline_snapshot.py:99: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:137: in run 236s recorder.fix_all() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 236s file.rewrite() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 236s new_code = self.new_code() 236s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 236s format_whole_file = enforce_formatting() or code == format_code( 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s 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]' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_34.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot= 236s output: 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s source: assert 5 in snapshot({0: [4, 5]})[0] 236s use flag: fix 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot=fix 236s output: 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s use flag: create 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot=create 236s output: 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s use flag: update 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s reported_flags: {'trim'} 236s run: pytest --inline-snapshot=update 236s output: 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: [4, 5]})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s ______________ test_generic[executing] [assert 5 in snapshot([])] ______________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 236s new_code=[self._file._value_to_code(v) for v in new_values], 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([]) 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py", line 9, in 236s assert 5 in snapshot([]) 236s ^^^^^^^^^^^^^^^^^ 236s AssertionError 236s ------------------------------ Captured log call ------------------------------- 236s 236s __________ test_generic[executing] [assert 5 in snapshot({0: []})[0]] __________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 236s new_code=[self._file._value_to_code(v) for v in new_values], 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: []})[0] 236s ----------------------------- Captured stderr call ----------------------------- 236s Traceback (most recent call last): 236s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py", line 9, in 236s assert 5 in snapshot({0: []})[0] 236s ^^^^^^^^^^^^^^^^^^^^^^^^^ 236s AssertionError 236s ------------------------------ Captured log call ------------------------------- 236s 236s ____________ test_generic[executing] [assert 5 in snapshot([3+2])] _____________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_37.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot([3+2]) 236s ------------------------------ Captured log call ------------------------------- 236s 236s ________ test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] _________ 236s 236s source = .w at 0x3ff8ddbbec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 236s executing_used = True 236s 236s def test_generic(source, subtests, executing_used): 236s codes = [] 236s 236s for op in operations: 236s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 236s if op.svalue: 236s codes.append( 236s ( 236s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 236s op.flag, 236s ) 236s ) 236s else: 236s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 236s 236s all_flags = ["trim", "fix", "create", "update"] 236s 236s for code, reported_flag in codes: 236s with subtests.test(code): 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:79: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_38.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |assert 5 in snapshot({0: [3+2]})[0] 236s ------------------------------ Captured log call ------------------------------- 236s 236s _______________ test_generic_multi[executing-create(==) fix(==)] _______________ 236s 236s source = .w at 0x3ff8db46b60> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='5', fvalue='4', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 5}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(4 == s["k_1"]) # fix 5 -> 4 236s _____________ test_generic_multi[executing-create(==) update(==)] ______________ 236s 236s source = .w at 0x3ff8db472e0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 2+2}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(4 == s["k_1"]) # update 2+2 -> 4 236s _____________ test_generic_multi[executing-create(==) create(<=)] ______________ 236s 236s source = .w at 0x3ff8db46ac0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(4 <= s["k_1"]) # create -> 4 236s ______________ test_generic_multi[executing-create(==) trim(<=)] _______________ 236s 236s source = .w at 0x3ff8db47ec0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 5}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(4 <= s["k_1"]) # trim 5 -> 4 236s _______________ test_generic_multi[executing-create(==) fix(<=)] _______________ 236s 236s source = .w at 0x3ff8d748900> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 4}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 <= s["k_1"]) # fix 4 -> 5 236s _____________ test_generic_multi[executing-create(==) update(<=)] ______________ 236s 236s source = .w at 0x3ff8db46c00> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 3+2}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 <= s["k_1"]) # update 3+2 -> 5 236s _____________ test_generic_multi[executing-create(==) create(>=)] ______________ 236s 236s source = .w at 0x3ff8d7485e0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 >= s["k_1"]) # create -> 5 236s ______________ test_generic_multi[executing-create(==) trim(>=)] _______________ 236s 236s source = .w at 0x3ff8d7499e0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 4}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 >= s["k_1"]) # trim 4 -> 5 236s _______________ test_generic_multi[executing-create(==) fix(>=)] _______________ 236s 236s source = .w at 0x3ff8db46b60> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 5}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(4 >= s["k_1"]) # fix 5 -> 4 236s _____________ test_generic_multi[executing-create(==) update(>=)] ______________ 236s 236s source = .w at 0x3ff8d7496c0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 3+2}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 >= s["k_1"]) # update 3+2 -> 5 236s _____________ test_generic_multi[executing-create(==) create(in)] ______________ 236s 236s source = .w at 0x3ff8d74aa20> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 in s["k_1"]) # create -> [5] 236s ______________ test_generic_multi[executing-create(==) trim(in)] _______________ 236s 236s source = .w at 0x3ff8ddb93a0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": [4, 5]}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 236s _______________ test_generic_multi[executing-create(==) fix(in)] _______________ 236s 236s source = .w at 0x3ff8db44a40> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": []}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 in s["k_1"]) # fix [] -> [5] 236s _____________ test_generic_multi[executing-create(==) update(in)] ______________ 236s 236s source = .w at 0x3ff8db449a0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py:10: in 236s print(4 == s["k_0"]) # create -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": [3+2]}) 236s |print(4 == s["k_0"]) # create -> 4 236s |print(5 in s["k_1"]) # update [3+2] -> [5] 236s _______________ test_generic_multi[executing-fix(==) update(==)] _______________ 236s 236s source = .w at 0x3ff8ddb93a0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 2+2}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(4 == s["k_1"]) # update 2+2 -> 4 236s _______________ test_generic_multi[executing-fix(==) create(<=)] _______________ 236s 236s source = .w at 0x3ff8db474c0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(4 <= s["k_1"]) # create -> 4 236s ________________ test_generic_multi[executing-fix(==) trim(<=)] ________________ 236s 236s source = .w at 0x3ff8d748fe0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 5}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(4 <= s["k_1"]) # trim 5 -> 4 236s ________________ test_generic_multi[executing-fix(==) fix(<=)] _________________ 236s 236s source = .w at 0x3ff8db47420> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 4}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 <= s["k_1"]) # fix 4 -> 5 236s _______________ test_generic_multi[executing-fix(==) update(<=)] _______________ 236s 236s source = .w at 0x3ff8d749d00> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 3+2}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 <= s["k_1"]) # update 3+2 -> 5 236s _______________ test_generic_multi[executing-fix(==) create(>=)] _______________ 236s 236s source = .w at 0x3ff8d74b600> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 >= s["k_1"]) # create -> 5 236s ________________ test_generic_multi[executing-fix(==) trim(>=)] ________________ 236s 236s source = .w at 0x3ff8db474c0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 4}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 >= s["k_1"]) # trim 4 -> 5 236s ________________ test_generic_multi[executing-fix(==) fix(>=)] _________________ 236s 236s source = .w at 0x3ff8d749da0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 5}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(4 >= s["k_1"]) # fix 5 -> 4 236s _______________ test_generic_multi[executing-fix(==) update(>=)] _______________ 236s 236s source = .w at 0x3ff8d668680> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": 3+2}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 >= s["k_1"]) # update 3+2 -> 5 236s _______________ test_generic_multi[executing-fix(==) create(in)] _______________ 236s 236s source = .w at 0x3ff8db47600> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 in s["k_1"]) # create -> [5] 236s ________________ test_generic_multi[executing-fix(==) trim(in)] ________________ 236s 236s source = .w at 0x3ff8d668d60> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 236s ________________ test_generic_multi[executing-fix(==) fix(in)] _________________ 236s 236s source = .w at 0x3ff8d669760> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": []}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 in s["k_1"]) # fix [] -> [5] 236s _______________ test_generic_multi[executing-fix(==) update(in)] _______________ 236s 236s source = .w at 0x3ff8db47600> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py:10: in 236s print(4 == s["k_0"]) # fix 5 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 236s |print(4 == s["k_0"]) # fix 5 -> 4 236s |print(5 in s["k_1"]) # update [3+2] -> [5] 236s _____________ test_generic_multi[executing-update(==) create(<=)] ______________ 236s 236s source = .w at 0x3ff8d669440> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(4 <= s["k_1"]) # create -> 4 236s ______________ test_generic_multi[executing-update(==) trim(<=)] _______________ 236s 236s source = .w at 0x3ff8d66a840> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": 5}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(4 <= s["k_1"]) # trim 5 -> 4 236s _______________ test_generic_multi[executing-update(==) fix(<=)] _______________ 236s 236s source = .w at 0x3ff8d74a520> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": 4}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 <= s["k_1"]) # fix 4 -> 5 236s _____________ test_generic_multi[executing-update(==) update(<=)] ______________ 236s 236s source = .w at 0x3ff8d669440> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 <= s["k_1"]) # update 3+2 -> 5 236s _____________ test_generic_multi[executing-update(==) create(>=)] ______________ 236s 236s source = .w at 0x3ff8d66b920> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 >= s["k_1"]) # create -> 5 236s ______________ test_generic_multi[executing-update(==) trim(>=)] _______________ 236s 236s source = .w at 0x3ff8d74bd80> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": 4}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 >= s["k_1"]) # trim 4 -> 5 236s _______________ test_generic_multi[executing-update(==) fix(>=)] _______________ 236s 236s source = .w at 0x3ff8d66b1a0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": 5}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(4 >= s["k_1"]) # fix 5 -> 4 236s _____________ test_generic_multi[executing-update(==) update(>=)] ______________ 236s 236s source = .w at 0x3ff8d530a40> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 >= s["k_1"]) # update 3+2 -> 5 236s _____________ test_generic_multi[executing-update(==) create(in)] ______________ 236s 236s source = .w at 0x3ff8d669080> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 in s["k_1"]) # create -> [5] 236s ______________ test_generic_multi[executing-update(==) trim(in)] _______________ 236s 236s source = .w at 0x3ff8d5302c0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": [4, 5]}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 236s _______________ test_generic_multi[executing-update(==) fix(in)] _______________ 236s 236s source = .w at 0x3ff8d5319e0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": []}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 in s["k_1"]) # fix [] -> [5] 236s _____________ test_generic_multi[executing-update(==) update(in)] ______________ 236s 236s source = .w at 0x3ff8d668fe0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:114: in run 236s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 236s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py:10: in 236s print(4 == s["k_0"]) # update 2+2 -> 4 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 236s return self == other 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 236s self._changes.append(next(it)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 236s new_code = self.context.file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_0": 2+2, "k_1": [3+2]}) 236s |print(4 == s["k_0"]) # update 2+2 -> 4 236s |print(5 in s["k_1"]) # update [3+2] -> [5] 236s ______________ test_generic_multi[executing-create(<=) trim(<=)] _______________ 236s 236s source = .w at 0x3ff8d531120> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c14/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 5}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(4 <= s["k_1"]) # trim 5 -> 4 236s True 236s True 236s _______________ test_generic_multi[executing-create(<=) fix(<=)] _______________ 236s 236s source = .w at 0x3ff8d532660> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c15/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 4}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(5 <= s["k_1"]) # fix 4 -> 5 236s True 236s False 236s _____________ test_generic_multi[executing-create(<=) update(<=)] ______________ 236s 236s source = .w at 0x3ff8d66a0c0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c16/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 3+2}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(5 <= s["k_1"]) # update 3+2 -> 5 236s True 236s True 236s _____________ test_generic_multi[executing-create(<=) create(>=)] ______________ 236s 236s source = .w at 0x3ff8d530540> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 236s to_insert.append((key, new_value_element._new_code())) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c17/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(5 >= s["k_1"]) # create -> 5 236s True 236s True 236s ______________ test_generic_multi[executing-create(<=) trim(>=)] _______________ 236s 236s source = .w at 0x3ff8d533600> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c18/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 4}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(5 >= s["k_1"]) # trim 4 -> 5 236s True 236s True 236s _______________ test_generic_multi[executing-create(<=) fix(>=)] _______________ 236s 236s source = .w at 0x3ff8e485440> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c19/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 5}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(4 >= s["k_1"]) # fix 5 -> 4 236s True 236s False 236s _____________ test_generic_multi[executing-create(<=) update(>=)] ______________ 236s 236s source = .w at 0x3ff8d74b7e0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 236s yield from self._new_value[key]._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 236s new_code = self._file._token_to_code(new_token) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '5 ' 236s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c20/test_1.py') 236s 236s def format_code(text, filename): 236s if _config.config.format_command is not None: 236s format_command = _config.config.format_command.format(filename=filename) 236s result = sp.run( 236s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 236s ) 236s if result.returncode != 0: 236s raise_problem( 236s f"""\ 236s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 236s """ 236s + result.stdout.decode("utf-8") 236s + result.stderr.decode("utf-8") 236s ) 236s return text 236s return result.stdout.decode("utf-8") 236s 236s try: 236s from black import main 236s from click.testing import CliRunner 236s except ImportError: 236s raise_problem( 236s f"""\ 236s [b]inline-snapshot is not able to format your code.[/b] 236s This issue can be solved by: 236s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 236s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 236s """ 236s ) 236s return text 236s 236s with warnings.catch_warnings(): 236s warnings.simplefilter("ignore") 236s 236s > runner = CliRunner(mix_stderr=False) 236s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 236s 236s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 236s ----------------------------- Captured stdout call ----------------------------- 236s [0, 1] 236s 236s input: 236s |""" 236s |PYTEST_DONT_REWRITE 236s |""" 236s |# äöß 🐍 236s |from inline_snapshot import snapshot 236s |from inline_snapshot import external 236s |from inline_snapshot import outsource 236s | 236s |s = snapshot({"k_1": 3+2}) 236s |print(4 <= s["k_0"]) # create -> 4 236s |print(5 >= s["k_1"]) # update 3+2 -> 5 236s True 236s True 236s _____________ test_generic_multi[executing-create(<=) create(in)] ______________ 236s 236s source = .w at 0x3ff8d74b1a0> 236s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 236s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 236s executing_used = True 236s 236s @pytest.mark.parametrize( 236s "ops", 236s [ 236s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 236s for ops in itertools.combinations(operations, 2) 236s ], 236s ) 236s def test_generic_multi(source, subtests, ops, executing_used): 236s 236s def gen_code(ops, fixed, old_keys): 236s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 236s new_keys = [] 236s 236s args = [] 236s print(keys) 236s for k in keys: 236s op = ops[k] 236s value = op.fvalue if op.flag in fixed else op.svalue 236s if value: 236s args.append(f'"k_{k}": {value}') 236s new_keys.append(k) 236s args = ", ".join(args) 236s 236s code = "s = snapshot({" + args + "})\n" 236s 236s for k, op in enumerate(ops): 236s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 236s 236s return code, new_keys 236s 236s all_flags = {op.flag for op in ops} 236s 236s keys = [] 236s code, keys = gen_code(ops, {}, keys) 236s > s = source(code) 236s 236s tests/test_inline_snapshot.py:141: 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s tests/conftest.py:158: in w 236s return Source(source=source).run() 236s tests/conftest.py:125: in run 236s changes += snapshot._changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 236s yield from self._value._get_changes() 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 236s to_insert.append((key, new_value_element._new_code())) 236s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 236s return self._file._value_to_code(self._new_value) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 236s return self._token_to_code(value_to_token(value)) 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 236s return self._format(tokenize.untokenize(tokens)).strip() 236s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 236s return format_code(text, Path(self._source.filename)) 236s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 236s 236s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c21/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({}) 237s |print(4 <= s["k_0"]) # create -> 4 237s |print(5 in s["k_1"]) # create -> [5] 237s True 237s True 237s ______________ test_generic_multi[executing-create(<=) trim(in)] _______________ 237s 237s source = .w at 0x3ff8db46b60> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 237s to_insert.append((key, new_value_element._new_code())) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c22/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": [4, 5]}) 237s |print(4 <= s["k_0"]) # create -> 4 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-create(<=) fix(in)] _______________ 237s 237s source = .w at 0x3ff8d74b560> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 237s new_code=[self._file._value_to_code(v) for v in new_values], 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c23/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": []}) 237s |print(4 <= s["k_0"]) # create -> 4 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s _____________ test_generic_multi[executing-create(<=) update(in)] ______________ 237s 237s source = .w at 0x3ff8d66b880> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c24/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": [3+2]}) 237s |print(4 <= s["k_0"]) # create -> 4 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s ________________ test_generic_multi[executing-trim(<=) fix(<=)] ________________ 237s 237s source = .w at 0x3ff8d74af20> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": 4}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 <= s["k_1"]) # fix 4 -> 5 237s True 237s False 237s ______________ test_generic_multi[executing-trim(<=) update(<=)] _______________ 237s 237s source = .w at 0x3ff8d669940> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t1/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": 3+2}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 <= s["k_1"]) # update 3+2 -> 5 237s True 237s True 237s ______________ test_generic_multi[executing-trim(<=) create(>=)] _______________ 237s 237s source = .w at 0x3ff8d669bc0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t2/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 >= s["k_1"]) # create -> 5 237s True 237s True 237s _______________ test_generic_multi[executing-trim(<=) trim(>=)] ________________ 237s 237s source = .w at 0x3ff8d74af20> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t3/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": 4}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 >= s["k_1"]) # trim 4 -> 5 237s True 237s True 237s ________________ test_generic_multi[executing-trim(<=) fix(>=)] ________________ 237s 237s source = .w at 0x3ff8d6696c0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t4/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": 5}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(4 >= s["k_1"]) # fix 5 -> 4 237s True 237s False 237s ______________ test_generic_multi[executing-trim(<=) update(>=)] _______________ 237s 237s source = .w at 0x3ff8d532fc0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t5/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": 3+2}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 >= s["k_1"]) # update 3+2 -> 5 237s True 237s True 237s ______________ test_generic_multi[executing-trim(<=) create(in)] _______________ 237s 237s source = .w at 0x3ff8d66b240> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t6/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 in s["k_1"]) # create -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-trim(<=) trim(in)] ________________ 237s 237s source = .w at 0x3ff8d530d60> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t7/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s ________________ test_generic_multi[executing-trim(<=) fix(in)] ________________ 237s 237s source = .w at 0x3ff8d530540> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t8/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": []}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s ______________ test_generic_multi[executing-trim(<=) update(in)] _______________ 237s 237s source = .w at 0x3ff8d66ade0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t9/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 237s |print(4 <= s["k_0"]) # trim 5 -> 4 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-fix(<=) update(<=)] _______________ 237s 237s source = .w at 0x3ff8d530fe0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f13/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": 3+2}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 <= s["k_1"]) # update 3+2 -> 5 237s False 237s True 237s _______________ test_generic_multi[executing-fix(<=) create(>=)] _______________ 237s 237s source = .w at 0x3ff8d4dc680> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f14/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 >= s["k_1"]) # create -> 5 237s False 237s True 237s ________________ test_generic_multi[executing-fix(<=) trim(>=)] ________________ 237s 237s source = .w at 0x3ff8d669940> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f15/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": 4}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 >= s["k_1"]) # trim 4 -> 5 237s False 237s True 237s ________________ test_generic_multi[executing-fix(<=) fix(>=)] _________________ 237s 237s source = .w at 0x3ff8d4dd120> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f16/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": 5}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(4 >= s["k_1"]) # fix 5 -> 4 237s False 237s False 237s _______________ test_generic_multi[executing-fix(<=) update(>=)] _______________ 237s 237s source = .w at 0x3ff8d4dd580> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f17/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": 3+2}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 >= s["k_1"]) # update 3+2 -> 5 237s False 237s True 237s _______________ test_generic_multi[executing-fix(<=) create(in)] _______________ 237s 237s source = .w at 0x3ff8d74ae80> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f18/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 in s["k_1"]) # create -> [5] 237s False 237s True 237s ________________ test_generic_multi[executing-fix(<=) trim(in)] ________________ 237s 237s source = .w at 0x3ff8d4dd260> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f19/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s False 237s True 237s ________________ test_generic_multi[executing-fix(<=) fix(in)] _________________ 237s 237s source = .w at 0x3ff8d4de700> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f20/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": []}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s False 237s False 237s _______________ test_generic_multi[executing-fix(<=) update(in)] _______________ 237s 237s source = .w at 0x3ff8d5327a0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f21/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 237s |print(5 <= s["k_0"]) # fix 4 -> 5 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s False 237s True 237s _____________ test_generic_multi[executing-update(<=) create(>=)] ______________ 237s 237s source = .w at 0x3ff8d4de020> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u12/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 >= s["k_1"]) # create -> 5 237s True 237s True 237s ______________ test_generic_multi[executing-update(<=) trim(>=)] _______________ 237s 237s source = .w at 0x3ff8d4df7e0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u13/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": 4}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 >= s["k_1"]) # trim 4 -> 5 237s True 237s True 237s _______________ test_generic_multi[executing-update(<=) fix(>=)] _______________ 237s 237s source = .w at 0x3ff8d532b60> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u14/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": 5}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(4 >= s["k_1"]) # fix 5 -> 4 237s True 237s False 237s _____________ test_generic_multi[executing-update(<=) update(>=)] ______________ 237s 237s source = .w at 0x3ff8d4dc5e0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==)]>>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u15/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": 3+2}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 >= s["k_1"]) # update 3+2 -> 5 237s True 237s True 237s _____________ test_generic_multi[executing-update(<=) create(in)] ______________ 237s 237s source = .w at 0x3ff8d494900> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u16/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # create -> [5] 237s True 237s True 237s ______________ test_generic_multi[executing-update(<=) trim(in)] _______________ 237s 237s source = .w at 0x3ff8d4dc5e0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u17/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-update(<=) fix(in)] _______________ 237s 237s source = .w at 0x3ff8d495440> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u18/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": []}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s _____________ test_generic_multi[executing-update(<=) update(in)] ______________ 237s 237s source = .w at 0x3ff8d495940> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u19/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 237s |print(5 <= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s ______________ test_generic_multi[executing-create(>=) trim(>=)] _______________ 237s 237s source = .w at 0x3ff8d4dc220> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) trim(>=)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c25/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": 4}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(5 >= s["k_1"]) # trim 4 -> 5 237s True 237s True 237s _______________ test_generic_multi[executing-create(>=) fix(>=)] _______________ 237s 237s source = .w at 0x3ff8d4dff60> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) fix(>=)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c26/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": 5}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(4 >= s["k_1"]) # fix 5 -> 4 237s True 237s False 237s _____________ test_generic_multi[executing-create(>=) update(>=)] ______________ 237s 237s source = .w at 0x3ff8d4deb60> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(>=)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c27/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": 3+2}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(5 >= s["k_1"]) # update 3+2 -> 5 237s True 237s True 237s _____________ test_generic_multi[executing-create(>=) create(in)] ______________ 237s 237s source = .w at 0x3ff8d4dc7c0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) create(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 237s to_insert.append((key, new_value_element._new_code())) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c28/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(5 in s["k_1"]) # create -> [5] 237s True 237s True 237s ______________ test_generic_multi[executing-create(>=) trim(in)] _______________ 237s 237s source = .w at 0x3ff8d4de980> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) trim(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 237s to_insert.append((key, new_value_element._new_code())) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c29/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": [4, 5]}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-create(>=) fix(in)] _______________ 237s 237s source = .w at 0x3ff8d4dfd80> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) fix(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 237s new_code=[self._file._value_to_code(v) for v in new_values], 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c30/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": []}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s _____________ test_generic_multi[executing-create(>=) update(in)] ______________ 237s 237s source = .w at 0x3ff8d66ab60> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c31/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": [3+2]}) 237s |print(5 >= s["k_0"]) # create -> 5 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s ________________ test_generic_multi[executing-trim(>=) fix(>=)] ________________ 237s 237s source = .w at 0x3ff8d668900> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) fix(>=)]>>) 237s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t10/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": 5}) 237s |print(5 >= s["k_0"]) # trim 4 -> 5 237s |print(4 >= s["k_1"]) # fix 5 -> 4 237s True 237s False 237s ______________ test_generic_multi[executing-trim(>=) update(>=)] _______________ 237s 237s source = .w at 0x3ff8d4df7e0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(>=)]>>) 237s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t11/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": 3+2}) 237s |print(5 >= s["k_0"]) # trim 4 -> 5 237s |print(5 >= s["k_1"]) # update 3+2 -> 5 237s True 237s True 237s ______________ test_generic_multi[executing-trim(>=) create(in)] _______________ 237s 237s source = .w at 0x3ff8d5325c0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) create(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t12/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4}) 237s |print(5 >= s["k_0"]) # trim 4 -> 5 237s |print(5 in s["k_1"]) # create -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-trim(>=) trim(in)] ________________ 237s 237s source = .w at 0x3ff8d4deca0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) trim(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t13/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 237s |print(5 >= s["k_0"]) # trim 4 -> 5 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s ________________ test_generic_multi[executing-trim(>=) fix(in)] ________________ 237s 237s source = .w at 0x3ff8d531940> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) fix(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t14/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": []}) 237s |print(5 >= s["k_0"]) # trim 4 -> 5 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s ______________ test_generic_multi[executing-trim(>=) update(in)] _______________ 237s 237s source = .w at 0x3ff8d494680> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t15/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 237s |print(5 >= s["k_0"]) # trim 4 -> 5 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-fix(>=) update(>=)] _______________ 237s 237s source = .w at 0x3ff8d533ec0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(>=)]>>) 237s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f22/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": 3+2}) 237s |print(4 >= s["k_0"]) # fix 5 -> 4 237s |print(5 >= s["k_1"]) # update 3+2 -> 5 237s False 237s True 237s _______________ test_generic_multi[executing-fix(>=) create(in)] _______________ 237s 237s source = .w at 0x3ff8d4deca0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) create(in)]>>) 237s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f23/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5}) 237s |print(4 >= s["k_0"]) # fix 5 -> 4 237s |print(5 in s["k_1"]) # create -> [5] 237s False 237s True 237s ________________ test_generic_multi[executing-fix(>=) trim(in)] ________________ 237s 237s source = .w at 0x3ff8d494cc0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) trim(in)]>>) 237s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f24/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 237s |print(4 >= s["k_0"]) # fix 5 -> 4 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s False 237s True 237s ________________ test_generic_multi[executing-fix(>=) fix(in)] _________________ 237s 237s source = .w at 0x3ff8d4dec00> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) fix(in)]>>) 237s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f25/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": []}) 237s |print(4 >= s["k_0"]) # fix 5 -> 4 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s False 237s False 237s _______________ test_generic_multi[executing-fix(>=) update(in)] _______________ 237s 237s source = .w at 0x3ff8d496700> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(in)]>>) 237s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f26/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 237s |print(4 >= s["k_0"]) # fix 5 -> 4 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s False 237s True 237s _____________ test_generic_multi[executing-update(>=) create(in)] ______________ 237s 237s source = .w at 0x3ff8d496ca0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) create(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u20/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2}) 237s |print(5 >= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # create -> [5] 237s True 237s True 237s ______________ test_generic_multi[executing-update(>=) trim(in)] _______________ 237s 237s source = .w at 0x3ff8ddbaf20> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) trim(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u21/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 237s |print(5 >= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-update(>=) fix(in)] _______________ 237s 237s source = .w at 0x3ff8d494900> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) fix(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u22/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": []}) 237s |print(5 >= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s _____________ test_generic_multi[executing-update(>=) update(in)] ______________ 237s 237s source = .w at 0x3ff8d497ce0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request==) update(in)]>>) 237s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u23/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 237s |print(5 >= s["k_0"]) # update 3+2 -> 5 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s ______________ test_generic_multi[executing-create(in) trim(in)] _______________ 237s 237s source = .w at 0x3ff8d496980> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 237s to_insert.append((key, new_value_element._new_code())) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '[5 ]' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c32/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": [4, 5]}) 237s |print(5 in s["k_0"]) # create -> [5] 237s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-create(in) fix(in)] _______________ 237s 237s source = .w at 0x3ff8d533600> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 237s new_code=[self._file._value_to_code(v) for v in new_values], 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c33/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": []}) 237s |print(5 in s["k_0"]) # create -> [5] 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s _____________ test_generic_multi[executing-create(in) update(in)] ______________ 237s 237s source = .w at 0x3ff8dc80cc0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c34/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_1": [3+2]}) 237s |print(5 in s["k_0"]) # create -> [5] 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s ________________ test_generic_multi[executing-trim(in) fix(in)] ________________ 237s 237s source = .w at 0x3ff8d496980> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 237s new_code=[self._file._value_to_code(v) for v in new_values], 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t16/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": [4, 5], "k_1": []}) 237s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 237s |print(5 in s["k_1"]) # fix [] -> [5] 237s True 237s False 237s ______________ test_generic_multi[executing-trim(in) update(in)] _______________ 237s 237s source = .w at 0x3ff8dc818a0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s 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')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t17/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": [4, 5], "k_1": [3+2]}) 237s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s True 237s True 237s _______________ test_generic_multi[executing-fix(in) update(in)] _______________ 237s 237s source = .w at 0x3ff8dc81da0> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx=>, request=>) 237s ops = (operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 237s executing_used = True 237s 237s @pytest.mark.parametrize( 237s "ops", 237s [ 237s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 237s for ops in itertools.combinations(operations, 2) 237s ], 237s ) 237s def test_generic_multi(source, subtests, ops, executing_used): 237s 237s def gen_code(ops, fixed, old_keys): 237s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 237s new_keys = [] 237s 237s args = [] 237s print(keys) 237s for k in keys: 237s op = ops[k] 237s value = op.fvalue if op.flag in fixed else op.svalue 237s if value: 237s args.append(f'"k_{k}": {value}') 237s new_keys.append(k) 237s args = ", ".join(args) 237s 237s code = "s = snapshot({" + args + "})\n" 237s 237s for k, op in enumerate(ops): 237s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 237s 237s return code, new_keys 237s 237s all_flags = {op.flag for op in ops} 237s 237s keys = [] 237s code, keys = gen_code(ops, {}, keys) 237s > s = source(code) 237s 237s tests/test_inline_snapshot.py:141: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 237s yield from self._new_value[key]._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 237s new_code=[self._file._value_to_code(v) for v in new_values], 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f27/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s [0, 1] 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot({"k_0": [], "k_1": [3+2]}) 237s |print(5 in s["k_0"]) # fix [] -> [5] 237s |print(5 in s["k_1"]) # update [3+2] -> [5] 237s False 237s True 237s _____________________________ test_mutable_values ______________________________ 237s 237s check_update = .w at 0x3ff8d3a1c60> 237s 237s def test_mutable_values(check_update): 237s assert ( 237s > check_update( 237s """ 237s l=[1,2] 237s assert l==snapshot() 237s l.append(3) 237s assert l==snapshot() 237s """, 237s flags="create", 237s number=2, 237s ) 237s == snapshot( 237s """\ 237s 237s l=[1,2] 237s assert l==snapshot([1, 2]) 237s l.append(3) 237s assert l==snapshot([1, 2, 3]) 237s """ 237s ) 237s ) 237s 237s tests/test_inline_snapshot.py:168: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py:11: in 237s assert l==snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s | 237s |l=[1,2] 237s |assert l==snapshot() 237s |l.append(3) 237s |assert l==snapshot() 237s _______________________________ test_comparison ________________________________ 237s 237s check_update = .w at 0x3ff8dc82020> 237s 237s def test_comparison(check_update): 237s > assert check_update("assert 5==snapshot()", flags="create") == snapshot( 237s "assert 5==snapshot(5)" 237s ) 237s 237s tests/test_inline_snapshot.py:257: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py:9: in 237s assert 5==snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert 5==snapshot() 237s ___________________________________ test_ge ____________________________________ 237s 237s check_update = .w at 0x3ff8dc813a0> 237s 237s def test_ge(check_update): 237s > assert check_update("assert 5<=snapshot()", flags="create") == snapshot( 237s "assert 5<=snapshot(5)" 237s ) 237s 237s tests/test_inline_snapshot.py:309: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 237s new_code = self._value._new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ge0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert 5<=snapshot() 237s ___________________________________ test_le ____________________________________ 237s 237s check_update = .w at 0x3ff8dc80fe0> 237s 237s def test_le(check_update): 237s > assert check_update("assert 5>=snapshot()", flags="create") == snapshot( 237s "assert 5>=snapshot(5)" 237s ) 237s 237s tests/test_inline_snapshot.py:381: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 237s new_code = self._value._new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_le0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert 5>=snapshot() 237s ________________________________ test_contains _________________________________ 237s 237s check_update = .w at 0x3ff8d532200> 237s 237s def test_contains(check_update): 237s > assert check_update("assert 5 in snapshot()", flags="create") == snapshot( 237s "assert 5 in snapshot([5])" 237s ) 237s 237s tests/test_inline_snapshot.py:449: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 237s new_code = self._value._new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 237s return self._file._value_to_code(self._new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '[5 ]' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_contains0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert 5 in snapshot() 237s _________________________________ test_getitem _________________________________ 237s 237s check_update = .w at 0x3ff8d74b240> 237s 237s def test_getitem(check_update): 237s > assert check_update('assert 5 == snapshot()["test"]', flags="create") == snapshot( 237s 'assert 5 == snapshot({"test": 5})["test"]' 237s ) 237s 237s tests/test_inline_snapshot.py:492: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py:9: in 237s assert 5 == snapshot()["test"] 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert 5 == snapshot()["test"] 237s _________________________________ test_assert __________________________________ 237s 237s check_update = .w at 0x3ff8dc80040> 237s 237s def test_assert(check_update): 237s > assert check_update("assert 2 == snapshot(5)", reported_flags="fix") 237s 237s tests/test_inline_snapshot.py:574: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py:9: in 237s assert 2 == snapshot(5) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert 2 == snapshot(5) 237s _______________________________ test_format_file _______________________________ 237s 237s check_update = .w at 0x3ff8d494680> 237s 237s def test_format_file(check_update): 237s > assert check_update( 237s 'assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot()\n', flags="create" 237s ) == snapshot( 237s """\ 237s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot([ 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s ]) 237s """ 237s ) 237s 237s tests/test_inline_snapshot.py:588: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py:9: in 237s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 237s ______________________________ test_format_value _______________________________ 237s 237s check_update = .w at 0x3ff8d494ea0> 237s 237s def test_format_value(check_update): 237s > assert check_update( 237s 'assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot()\n', flags="create" 237s ) == snapshot( 237s """\ 237s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot([ 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s "aaaaaaaaaaaaaaaaa", 237s ]) 237s """ 237s ) 237s 237s tests/test_inline_snapshot.py:604: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py:9: in 237s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 237s _______________________________ test_type_error ________________________________ 237s 237s check_update = .w at 0x3ff8d4972e0> 237s 237s def test_type_error(check_update): 237s tests = ["5 == s", "5 <= s", "5 >= s", "5 in s", "5 == s[0]"] 237s 237s for test1, test2 in itertools.product(tests, tests): 237s with pytest.raises(TypeError) if test1 != test2 else nullcontext() as error: 237s > check_update( 237s f""" 237s s = snapshot() 237s assert {test1} 237s assert {test2} 237s """, 237s reported_flags="create", 237s ) 237s 237s tests/test_inline_snapshot.py:631: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py:11: in 237s assert 5 == s 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s | 237s |s = snapshot() 237s |assert 5 == s 237s |assert 5 == s 237s _________________________ test_different_snapshot_name _________________________ 237s 237s check_update = .w at 0x3ff8d532fc0> 237s 237s def test_different_snapshot_name(check_update): 237s 237s assert ( 237s > check_update( 237s """\ 237s from inline_snapshot import snapshot as s 237s assert 4==s() 237s 237s """, 237s flags="create", 237s ) 237s == snapshot( 237s """\ 237s from inline_snapshot import snapshot as s 237s assert 4==s(4) 237s 237s """ 237s ) 237s ) 237s 237s tests/test_inline_snapshot.py:695: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py:10: in 237s assert 4==s() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |from inline_snapshot import snapshot as s 237s |assert 4==s() 237s | 237s _______________________ test_quoting_change_is_no_update _______________________ 237s 237s source = .w at 0x3ff8d4df4c0> 237s 237s def test_quoting_change_is_no_update(source): 237s 237s > s = source( 237s """\ 237s from inline_snapshot import external,snapshot 237s 237s class X: 237s def __init__(self,a): 237s self.a=a 237s pass 237s 237s def __repr__(self): 237s return f'X("{self.a}")' 237s 237s def __eq__(self,other): 237s if not hasattr(other,"a"): 237s return NotImplemented 237s return other.a==self.a 237s 237s assert X("a") == snapshot() 237s """ 237s ) 237s 237s tests/test_inline_snapshot.py:731: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py:24: in 237s assert X("a") == snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |from inline_snapshot import external,snapshot 237s | 237s |class X: 237s | def __init__(self,a): 237s | self.a=a 237s | pass 237s | 237s | def __repr__(self): 237s | return f'X("{self.a}")' 237s | 237s | def __eq__(self,other): 237s | if not hasattr(other,"a"): 237s | return NotImplemented 237s | return other.a==self.a 237s | 237s |assert X("a") == snapshot() 237s _____________________________ test_trailing_comma ______________________________ 237s 237s project = .Project object at 0x3ff8d3d8f50> 237s 237s def test_trailing_comma(project): 237s 237s project.setup( 237s """\ 237s from inline_snapshot import external, snapshot 237s 237s class X: 237s def __init__(self, *args): 237s self.args = args 237s 237s def __repr__(self): 237s return f"X({', '.join(map(repr,self.args))})" 237s 237s def __eq__(self,other): 237s if not isinstance(other,X): 237s return NotImplemented 237s 237s return self.args == other.args 237s 237s def test_thing(): 237s assert X("a" * 40, "a" * 40) == snapshot() 237s """ 237s ) 237s 237s > project.format() 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_inline_snapshot.py:805: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py:315: in format 237s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_trailing_comma0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s from inline_snapshot import external, snapshot 237s 237s class X: 237s def __init__(self, *args): 237s self.args = args 237s 237s def __repr__(self): 237s return f"X({', '.join(map(repr,self.args))})" 237s 237s def __eq__(self,other): 237s if not isinstance(other,X): 237s return NotImplemented 237s 237s return self.args == other.args 237s 237s def test_thing(): 237s assert X("a" * 40, "a" * 40) == snapshot() 237s 237s ___________________________________ test_is ____________________________________ 237s 237s def test_is(): 237s 237s Example( 237s """ 237s from inline_snapshot import snapshot,Is 237s 237s def test_Is(): 237s for i in range(3): 237s assert ["hello",i] == snapshot(["hi",Is(i)]) 237s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 237s """ 237s > ).run_inline( 237s ["--inline-snapshot=create"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s 237s from inline_snapshot import snapshot,Is 237s 237s def test_Is(): 237s for i in range(3): 237s assert ["hello",i] == snapshot(["hi",Is(i)]) 237s assert ["hello",i] == snapshot({1:["hi",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 237s """ 237s } 237s ), 237s ).run_inline( 237s ["--inline-snapshot=fix"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s 237s from inline_snapshot import snapshot,Is 237s 237s def test_Is(): 237s for i in range(3): 237s assert ["hello",i] == snapshot(["hello",Is(i)]) 237s assert ["hello",i] == snapshot({1:["hello",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 237s """ 237s } 237s ), 237s ) 237s 237s tests/test_inline_snapshot.py:912: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--inline-snapshot=create'] 237s 237s def run_inline( 237s self, 237s args: list[str] = [], 237s *, 237s reported_categories: Snapshot[list[Category]] | None = None, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s raises: Snapshot[str] | None = None, 237s ) -> Example: 237s """Execute the example files in process and run every `test_*` 237s function. 237s 237s This is useful for fast test execution. 237s 237s Parameters: 237s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 237s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 237s changed_files: snapshot of files which are changed by this run. 237s raises: snapshot of the exception which is raised during the test execution. 237s It is required if your code raises an exception. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s parser = ArgumentParser() 237s 237s parser.add_argument( 237s "--inline-snapshot", 237s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 237s dest="inline_snapshot", 237s help="update specific snapshot values:\n" 237s "disable: disable the snapshot logic\n" 237s "short-report: show a short report\n" 237s "report: show a longer report with a diff report\n" 237s "review: allow to approve the changes interactive\n" 237s "create: creates snapshots which are currently not defined\n" 237s "update: update snapshots even if they are defined\n" 237s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 237s "fix: change snapshots which currently break your tests\n", 237s ) 237s parsed_args = parser.parse_args(args) 237s flags = (parsed_args.inline_snapshot or "").split(",") 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s 237s self._write_files(tmp_path) 237s 237s raised_exception = None 237s with snapshot_env(): 237s with ChangeRecorder().activate() as recorder: 237s _inline_snapshot._update_flags = Flags({*flags}) 237s inline_snapshot._external.storage = ( 237s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 237s ) 237s 237s try: 237s for filename in tmp_path.glob("*.py"): 237s globals: dict[str, Any] = {} 237s print("run> pytest", filename) 237s exec( 237s compile(filename.read_text("utf-8"), filename, "exec"), 237s globals, 237s ) 237s 237s # run all test_* functions 237s for k, v in globals.items(): 237s if k.startswith("test_") and callable(v): 237s v() 237s except Exception as e: 237s traceback.print_exc() 237s raised_exception = e 237s 237s finally: 237s _inline_snapshot._active = False 237s 237s changes = [] 237s for snapshot in _inline_snapshot.snapshots.values(): 237s changes += snapshot._changes() 237s 237s snapshot_flags = {change.flag for change in changes} 237s 237s apply_all( 237s [ 237s change 237s for change in changes 237s if change.flag in _inline_snapshot._update_flags.to_set() 237s ] 237s ) 237s recorder.fix_all() 237s 237s report_output = StringIO() 237s console = Console(file=report_output) 237s 237s # TODO: add all the report output here 237s report_problems(console) 237s 237s if reported_categories is not None: 237s assert sorted(snapshot_flags) == reported_categories 237s 237s if raised_exception is not None: 237s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 237s raised_exception 237s ) 237s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 237s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s 237s from inline_snapshot import snapshot,Is 237s 237s def test_Is(): 237s for i in range(3): 237s assert ["hello",i] == snapshot(["hi",Is(i)]) 237s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 237s 237s 237s run> pytest /tmp/tmpyqqnqv57/test_something.py 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 237s v() 237s File "/tmp/tmpyqqnqv57/test_something.py", line 6, in test_Is 237s assert ["hello",i] == snapshot(["hi",Is(i)]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 237s return self == other 237s ^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 237s self._changes.append(next(it)) 237s ^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 237s v = yield from self.get_adapter( 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 237s new_code = self.context.file._token_to_code(new_token) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 237s return format_code(text, Path(self._source.filename)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 237s runner = CliRunner(mix_stderr=False) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s _______________________________ test_missing_is ________________________________ 237s 237s def test_missing_is(): 237s 237s Example( 237s """\ 237s from inline_snapshot import snapshot 237s 237s def test_is(): 237s for i in (1,2): 237s assert i == snapshot(i) 237s """ 237s > ).run_inline( 237s raises=snapshot( 237s """\ 237s UsageError: 237s snapshot value should not change. Use Is(...) for dynamic snapshot parts.\ 237s """ 237s ) 237s ) 237s 237s tests/test_is.py:15: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 237s assert raises == f"{type(raised_exception).__name__}:\n" + str( 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_is.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s from inline_snapshot import snapshot 237s 237s def test_is(): 237s for i in (1,2): 237s assert i == snapshot(i) 237s 237s 237s run> pytest /tmp/tmpwt3bs08_/test_something.py 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 237s v() 237s File "/tmp/tmpwt3bs08_/test_something.py", line 5, in test_is 237s assert i == snapshot(i) 237s ^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 237s return self == other 237s ^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 237s self._changes.append(next(it)) 237s ^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 237s new_code = self.context.file._token_to_code(new_token) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 237s return format_code(text, Path(self._source.filename)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 237s runner = CliRunner(mix_stderr=False) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s __________________________________ test_repr ___________________________________ 237s 237s def test_repr(): 237s Example( 237s """\ 237s from inline_snapshot import snapshot 237s from tests._is_normalized import IsNormalized 237s 237s def test_a(): 237s n=IsNormalized(sorted,snapshot()) 237s assert [3,5,2] == n 237s assert repr(n)==snapshot() 237s """ 237s > ).run_inline( 237s ["--inline-snapshot=create"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s from inline_snapshot import snapshot 237s from tests._is_normalized import IsNormalized 237s 237s def test_a(): 237s n=IsNormalized(sorted,snapshot([2, 3, 5])) 237s assert [3,5,2] == n 237s assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])") 237s """ 237s } 237s ), 237s ) 237s 237s tests/test_is_normalized.py:16: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--inline-snapshot=create'] 237s 237s def run_inline( 237s self, 237s args: list[str] = [], 237s *, 237s reported_categories: Snapshot[list[Category]] | None = None, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s raises: Snapshot[str] | None = None, 237s ) -> Example: 237s """Execute the example files in process and run every `test_*` 237s function. 237s 237s This is useful for fast test execution. 237s 237s Parameters: 237s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 237s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 237s changed_files: snapshot of files which are changed by this run. 237s raises: snapshot of the exception which is raised during the test execution. 237s It is required if your code raises an exception. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s parser = ArgumentParser() 237s 237s parser.add_argument( 237s "--inline-snapshot", 237s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 237s dest="inline_snapshot", 237s help="update specific snapshot values:\n" 237s "disable: disable the snapshot logic\n" 237s "short-report: show a short report\n" 237s "report: show a longer report with a diff report\n" 237s "review: allow to approve the changes interactive\n" 237s "create: creates snapshots which are currently not defined\n" 237s "update: update snapshots even if they are defined\n" 237s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 237s "fix: change snapshots which currently break your tests\n", 237s ) 237s parsed_args = parser.parse_args(args) 237s flags = (parsed_args.inline_snapshot or "").split(",") 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s 237s self._write_files(tmp_path) 237s 237s raised_exception = None 237s with snapshot_env(): 237s with ChangeRecorder().activate() as recorder: 237s _inline_snapshot._update_flags = Flags({*flags}) 237s inline_snapshot._external.storage = ( 237s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 237s ) 237s 237s try: 237s for filename in tmp_path.glob("*.py"): 237s globals: dict[str, Any] = {} 237s print("run> pytest", filename) 237s exec( 237s compile(filename.read_text("utf-8"), filename, "exec"), 237s globals, 237s ) 237s 237s # run all test_* functions 237s for k, v in globals.items(): 237s if k.startswith("test_") and callable(v): 237s v() 237s except Exception as e: 237s traceback.print_exc() 237s raised_exception = e 237s 237s finally: 237s _inline_snapshot._active = False 237s 237s changes = [] 237s for snapshot in _inline_snapshot.snapshots.values(): 237s changes += snapshot._changes() 237s 237s snapshot_flags = {change.flag for change in changes} 237s 237s apply_all( 237s [ 237s change 237s for change in changes 237s if change.flag in _inline_snapshot._update_flags.to_set() 237s ] 237s ) 237s recorder.fix_all() 237s 237s report_output = StringIO() 237s console = Console(file=report_output) 237s 237s # TODO: add all the report output here 237s report_problems(console) 237s 237s if reported_categories is not None: 237s assert sorted(snapshot_flags) == reported_categories 237s 237s if raised_exception is not None: 237s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 237s raised_exception 237s ) 237s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 237s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s from inline_snapshot import snapshot 237s from tests._is_normalized import IsNormalized 237s 237s def test_a(): 237s n=IsNormalized(sorted,snapshot()) 237s assert [3,5,2] == n 237s assert repr(n)==snapshot() 237s 237s 237s run> pytest /tmp/tmpxownt8dl/test_something.py 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 237s v() 237s File "/tmp/tmpxownt8dl/test_something.py", line 6, in test_a 237s assert [3,5,2] == n 237s ^^^^^^^^^^^^ 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/_is_normalized.py", line 13, in __eq__ 237s return self._last_value == self._value 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 237s return self == other 237s ^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 237s self._changes.append(next(it)) 237s ^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 237s new_code = self.context.file._token_to_code(new_token) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 237s return format_code(text, Path(self._source.filename)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 237s runner = CliRunner(mix_stderr=False) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s ______________________________ test_fix_list_fix _______________________________ 237s 237s check_update = .w at 0x3ff8d3a2340> 237s 237s def test_fix_list_fix(check_update): 237s > assert check_update( 237s """assert [1,2]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix" 237s ) == snapshot("assert [1,2]==snapshot([0+1,2])") 237s 237s tests/test_preserve_values.py:9: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py:9: in 237s assert [1,2]==snapshot([0+1,3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [1,2]==snapshot([0+1,3]) 237s _____________________________ test_fix_list_insert _____________________________ 237s 237s check_update = .w at 0x3ff8dc83e20> 237s 237s def test_fix_list_insert(check_update): 237s > assert check_update( 237s """assert [1,2,3,4,5,6]==snapshot([0+1,3])""", 237s reported_flags="update,fix", 237s flags="fix", 237s ) == snapshot("assert [1,2,3,4,5,6]==snapshot([0+1, 2, 3, 4, 5, 6])") 237s 237s tests/test_preserve_values.py:15: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py:9: in 237s assert [1,2,3,4,5,6]==snapshot([0+1,3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [1,2,3,4,5,6]==snapshot([0+1,3]) 237s _____________________________ test_fix_list_delete _____________________________ 237s 237s check_update = .w at 0x3ff8d375440> 237s 237s def test_fix_list_delete(check_update): 237s > assert check_update( 237s """assert [1,5]==snapshot([0+1,2,3,4,5])""", 237s reported_flags="update,fix", 237s flags="fix", 237s ) == snapshot("assert [1,5]==snapshot([0+1, 5])") 237s 237s tests/test_preserve_values.py:23: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py:9: in 237s assert [1,5]==snapshot([0+1,2,3,4,5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [1,5]==snapshot([0+1,2,3,4,5]) 237s ____________________________ test_fix_tuple_delete _____________________________ 237s 237s check_update = .w at 0x3ff8dc83e20> 237s 237s def test_fix_tuple_delete(check_update): 237s > assert check_update( 237s """assert (1,5)==snapshot((0+1,2,3,4,5))""", 237s reported_flags="update,fix", 237s flags="fix", 237s ) == snapshot("assert (1,5)==snapshot((0+1, 5))") 237s 237s tests/test_preserve_values.py:31: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py:9: in 237s assert (1,5)==snapshot((0+1,2,3,4,5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (1,5)==snapshot((0+1,2,3,4,5)) 237s _____________________________ test_fix_dict_change _____________________________ 237s 237s check_update = .w at 0x3ff8d375940> 237s 237s def test_fix_dict_change(check_update): 237s > assert check_update( 237s """assert {1:1, 2:2}==snapshot({1:0+1, 2:3})""", 237s reported_flags="update,fix", 237s flags="fix", 237s ) == snapshot("assert {1:1, 2:2}==snapshot({1:0+1, 2:2})") 237s 237s tests/test_preserve_values.py:39: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py:9: in 237s assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 237s _____________________________ test_fix_dict_remove _____________________________ 237s 237s check_update = .w at 0x3ff8d3742c0> 237s 237s def test_fix_dict_remove(check_update): 237s > assert check_update( 237s """assert {1:1}==snapshot({0:0, 1:0+1, 2:2})""", 237s reported_flags="update,fix", 237s flags="fix", 237s ) == snapshot("assert {1:1}==snapshot({1:0+1})") 237s 237s tests/test_preserve_values.py:47: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py:9: in 237s assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 237s _____________________________ test_fix_dict_insert _____________________________ 237s 237s check_update = .w at 0x3ff8d3756c0> 237s 237s def test_fix_dict_insert(check_update): 237s > assert check_update( 237s """assert {0:"before",1:1,2:"after"}==snapshot({1:0+1})""", 237s reported_flags="update,fix", 237s flags="fix", 237s ) == snapshot( 237s 'assert {0:"before",1:1,2:"after"}==snapshot({0: "before", 1:0+1, 2: "after"})' 237s ) 237s 237s tests/test_preserve_values.py:61: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py:9: in 237s assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 237s _____________________ test_fix_dict_with_non_literal_keys ______________________ 237s 237s check_update = .w at 0x3ff8d376b60> 237s 237s def test_fix_dict_with_non_literal_keys(check_update): 237s > assert check_update( 237s """assert {1+2:"3"}==snapshot({1+2:"5"})""", 237s reported_flags="fix", 237s flags="fix", 237s ) == snapshot('assert {1+2:"3"}==snapshot({1+2:"3"})') 237s 237s tests/test_preserve_values.py:71: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py:9: in 237s assert {1+2:"3"}==snapshot({1+2:"5"}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "'3'" 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1+2:"3"}==snapshot({1+2:"5"}) 237s _______________________ test_no_update_for_dirty_equals ________________________ 237s 237s check_update = .w at 0x3ff8d377420> 237s 237s @pytest.mark.skipif( 237s sys.version_info < (3, 8), reason="dirty equals has dropped the 3.7 support" 237s ) 237s def test_no_update_for_dirty_equals(check_update): 237s assert ( 237s > check_update( 237s """\ 237s from dirty_equals import IsInt 237s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 237s """, 237s reported_flags="update", 237s flags="update", 237s ) 237s == snapshot( 237s """\ 237s from dirty_equals import IsInt 237s assert {5:5,2:2}==snapshot({5:IsInt(),2:2}) 237s """ 237s ) 237s ) 237s 237s tests/test_preserve_values.py:83: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py:10: in 237s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |from dirty_equals import IsInt 237s |assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 237s _____________________ test_preserve_case_from_original_mr ______________________ 237s 237s check_update = .w at 0x3ff8d374900> 237s 237s def test_preserve_case_from_original_mr(check_update): 237s assert ( 237s > check_update( 237s """\ 237s left = { 237s "a": 1, 237s "b": { 237s "c": 2, 237s "d": [ 237s 3, 237s 4, 237s 5, 237s ], 237s }, 237s "e": ( 237s { 237s "f": 6, 237s "g": 7, 237s }, 237s ), 237s } 237s assert left == snapshot( 237s { 237s "a": 10, 237s "b": { 237s "c": 2 * 1 + 0, 237s "d": [ 237s int(3), 237s 40, 237s 5, 237s ], 237s "h": 8, 237s }, 237s "e": ( 237s { 237s "f": 3 + 3, 237s }, 237s 9, 237s ), 237s } 237s ) 237s """, 237s reported_flags="update,fix", 237s flags="fix", 237s ) 237s == snapshot( 237s """\ 237s left = { 237s "a": 1, 237s "b": { 237s "c": 2, 237s "d": [ 237s 3, 237s 4, 237s 5, 237s ], 237s }, 237s "e": ( 237s { 237s "f": 6, 237s "g": 7, 237s }, 237s ), 237s } 237s assert left == snapshot( 237s { 237s "a": 1, 237s "b": { 237s "c": 2 * 1 + 0, 237s "d": [ 237s int(3), 237s 4, 237s 5, 237s ]}, 237s "e": ({"f": 6, "g": 7},), 237s } 237s ) 237s """ 237s ) 237s ) 237s 237s tests/test_preserve_values.py:103: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py:26: in 237s assert left == snapshot( 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |left = { 237s | "a": 1, 237s | "b": { 237s | "c": 2, 237s | "d": [ 237s | 3, 237s | 4, 237s | 5, 237s | ], 237s | }, 237s | "e": ( 237s | { 237s | "f": 6, 237s | "g": 7, 237s | }, 237s | ), 237s |} 237s |assert left == snapshot( 237s | { 237s | "a": 10, 237s | "b": { 237s | "c": 2 * 1 + 0, 237s | "d": [ 237s | int(3), 237s | 40, 237s | 5, 237s | ], 237s | "h": 8, 237s | }, 237s | "e": ( 237s | { 237s | "f": 3 + 3, 237s | }, 237s | 9, 237s | ), 237s | } 237s |) 237s _____________________ test_generic [[5, 5, 5] -> [] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_3.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert []==snapshot([5, 5, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert []==snapshot([5, 5, 5]) 237s source: assert []==snapshot([5, 5, 5]) 237s set(): 237s assert []==snapshot([5, 5, 5]) 237s assert []==snapshot([5, 5, 5]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert []==snapshot([5, 5, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert []==snapshot([5, 5, 5]) 237s {'fix'}: 237s assert []==snapshot([5, 5, 5]) 237s assert []==snapshot([]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert []==snapshot([5, 5, 5]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_1.py", line 9, in 237s assert []==snapshot([5, 5, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_2.py", line 9, in 237s assert []==snapshot([5, 5, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py:9: in 237s assert [8]==snapshot([5, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8]==snapshot([5, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[5, 5, 2+2] -> [4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py:9: in 237s assert [4]==snapshot([5, 5, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4]==snapshot([5, 5, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[5, 5, 3] -> [3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_8.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([5, 5, 3]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3]==snapshot([5, 5, 3]) 237s source: assert [3]==snapshot([5, 5, 3]) 237s set(): 237s assert [3]==snapshot([5, 5, 3]) 237s assert [3]==snapshot([5, 5, 3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([5, 5, 3]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3]==snapshot([5, 5, 3]) 237s {'fix'}: 237s assert [3]==snapshot([5, 5, 3]) 237s assert [3]==snapshot([3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([5, 5, 3]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_6.py", line 9, in 237s assert [3]==snapshot([5, 5, 3]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_7.py", line 9, in 237s assert [3]==snapshot([5, 5, 3]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py:9: in 237s assert [8]==snapshot([5, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8]==snapshot([5, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py:9: in 237s assert [8, 8]==snapshot([5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 8]==snapshot([5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py:9: in 237s assert [8, 4]==snapshot([5, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 4]==snapshot([5, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py:9: in 237s assert [8, 3]==snapshot([5, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 3]==snapshot([5, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[5, 2+2, 5] -> [4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py:9: in 237s assert [4]==snapshot([5, 2+2, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4]==snapshot([5, 2+2, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[5, 2+2] -> [4, 8] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py:9: in 237s assert [4, 8]==snapshot([5, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 8]==snapshot([5, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[5, 2+2, 2+2] -> [4, 4] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py:9: in 237s assert [4, 4]==snapshot([5, 2+2, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 4]==snapshot([5, 2+2, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[5, 2+2, 3] -> [4, 3] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py:9: in 237s assert [4, 3]==snapshot([5, 2+2, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 3]==snapshot([5, 2+2, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[5, 3, 5] -> [3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_19.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([5, 3, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3]==snapshot([5, 3, 5]) 237s source: assert [3]==snapshot([5, 3, 5]) 237s set(): 237s assert [3]==snapshot([5, 3, 5]) 237s assert [3]==snapshot([5, 3, 5]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([5, 3, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3]==snapshot([5, 3, 5]) 237s {'fix'}: 237s assert [3]==snapshot([5, 3, 5]) 237s assert [3]==snapshot([3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([5, 3, 5]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_17.py", line 9, in 237s assert [3]==snapshot([5, 3, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_18.py", line 9, in 237s assert [3]==snapshot([5, 3, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[5, 3] -> [3, 8] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py:9: in 237s assert [3, 8]==snapshot([5, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 8]==snapshot([5, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[5, 3, 2+2] -> [3, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py:9: in 237s assert [3, 4]==snapshot([5, 3, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 4]==snapshot([5, 3, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [[5, 3, 3] -> [3, 3] ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_24.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([5, 3, 3]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3, 3]==snapshot([5, 3, 3]) 237s source: assert [3, 3]==snapshot([5, 3, 3]) 237s set(): 237s assert [3, 3]==snapshot([5, 3, 3]) 237s assert [3, 3]==snapshot([5, 3, 3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([5, 3, 3]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3, 3]==snapshot([5, 3, 3]) 237s {'fix'}: 237s assert [3, 3]==snapshot([5, 3, 3]) 237s assert [3, 3]==snapshot([3, 3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([5, 3, 3]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_22.py", line 9, in 237s assert [3, 3]==snapshot([5, 3, 3]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_23.py", line 9, in 237s assert [3, 3]==snapshot([5, 3, 3]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py:9: in 237s assert [8]==snapshot([5, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8]==snapshot([5, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py:9: in 237s assert [8, 8]==snapshot([5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 8]==snapshot([5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py:9: in 237s assert [8, 4]==snapshot([5, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 4]==snapshot([5, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py:9: in 237s assert [8, 3]==snapshot([5, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 3]==snapshot([5, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py:9: in 237s assert [8, 8]==snapshot([5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 8]==snapshot([5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [[] -> [8, 8, 8] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py:9: in 237s assert [8, 8, 8]==snapshot([]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 8, 8]==snapshot([]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2] -> [8, 8, 4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py:9: in 237s assert [8, 8, 4]==snapshot([2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 8, 4]==snapshot([2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3] -> [8, 8, 3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py:9: in 237s assert [8, 8, 3]==snapshot([3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 8, 3]==snapshot([3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2, 5] -> [8, 4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py:9: in 237s assert [8, 4]==snapshot([2+2, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 4]==snapshot([2+2, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2] -> [8, 4, 8] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py:9: in 237s assert [8, 4, 8]==snapshot([2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 4, 8]==snapshot([2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[2+2, 2+2] -> [8, 4, 4] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py:9: in 237s assert [8, 4, 4]==snapshot([2+2, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 4, 4]==snapshot([2+2, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 3] -> [8, 4, 3] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py:9: in 237s assert [8, 4, 3]==snapshot([2+2, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 4, 3]==snapshot([2+2, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3, 5] -> [8, 3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py:9: in 237s assert [8, 3]==snapshot([3, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 3]==snapshot([3, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3] -> [8, 3, 8] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py:9: in 237s assert [8, 3, 8]==snapshot([3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 3, 8]==snapshot([3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[3, 2+2] -> [8, 3, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py:9: in 237s assert [8, 3, 4]==snapshot([3, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 3, 4]==snapshot([3, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [[3, 3] -> [8, 3, 3] ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py:9: in 237s assert [8, 3, 3]==snapshot([3, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [8, 3, 3]==snapshot([3, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2, 5, 5] -> [4] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py:9: in 237s assert [4]==snapshot([2+2, 5, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4]==snapshot([2+2, 5, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py:9: in 237s assert [4, 8]==snapshot([2+2, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 8]==snapshot([2+2, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[2+2, 5, 2+2] -> [4, 4] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py:9: in 237s assert [4, 4]==snapshot([2+2, 5, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 4]==snapshot([2+2, 5, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 5, 3] -> [4, 3] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py:9: in 237s assert [4, 3]==snapshot([2+2, 5, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 3]==snapshot([2+2, 5, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py:9: in 237s assert [4, 8]==snapshot([2+2, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 8]==snapshot([2+2, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2] -> [4, 8, 8] ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py:9: in 237s assert [4, 8, 8]==snapshot([2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 8, 8]==snapshot([2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[2+2, 2+2] -> [4, 8, 4] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py:9: in 237s assert [4, 8, 4]==snapshot([2+2, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 8, 4]==snapshot([2+2, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 3] -> [4, 8, 3] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py:9: in 237s assert [4, 8, 3]==snapshot([2+2, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 8, 3]==snapshot([2+2, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[2+2, 2+2, 5] -> [4, 4] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py:9: in 237s assert [4, 4]==snapshot([2+2, 2+2, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 4]==snapshot([2+2, 2+2, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[2+2, 2+2] -> [4, 4, 8] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py:9: in 237s assert [4, 4, 8]==snapshot([2+2, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 4, 8]==snapshot([2+2, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py:9: in 237s assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py:9: in 237s assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 3, 5] -> [4, 3] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py:9: in 237s assert [4, 3]==snapshot([2+2, 3, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 3]==snapshot([2+2, 3, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 3] -> [4, 3, 8] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py:9: in 237s assert [4, 3, 8]==snapshot([2+2, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 3, 8]==snapshot([2+2, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py:9: in 237s assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[2+2, 3, 3] -> [4, 3, 3] ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py:9: in 237s assert [4, 3, 3]==snapshot([2+2, 3, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [4, 3, 3]==snapshot([2+2, 3, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3, 5, 5] -> [3] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_59.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([3, 5, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3]==snapshot([3, 5, 5]) 237s source: assert [3]==snapshot([3, 5, 5]) 237s set(): 237s assert [3]==snapshot([3, 5, 5]) 237s assert [3]==snapshot([3, 5, 5]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([3, 5, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3]==snapshot([3, 5, 5]) 237s {'fix'}: 237s assert [3]==snapshot([3, 5, 5]) 237s assert [3]==snapshot([3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3]==snapshot([3, 5, 5]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_57.py", line 9, in 237s assert [3]==snapshot([3, 5, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_58.py", line 9, in 237s assert [3]==snapshot([3, 5, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py:9: in 237s assert [3, 8]==snapshot([3, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 8]==snapshot([3, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[3, 5, 2+2] -> [3, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py:9: in 237s assert [3, 4]==snapshot([3, 5, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 4]==snapshot([3, 5, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [[3, 5, 3] -> [3, 3] ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_64.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([3, 5, 3]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3, 3]==snapshot([3, 5, 3]) 237s source: assert [3, 3]==snapshot([3, 5, 3]) 237s set(): 237s assert [3, 3]==snapshot([3, 5, 3]) 237s assert [3, 3]==snapshot([3, 5, 3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([3, 5, 3]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3, 3]==snapshot([3, 5, 3]) 237s {'fix'}: 237s assert [3, 3]==snapshot([3, 5, 3]) 237s assert [3, 3]==snapshot([3, 3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([3, 5, 3]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_62.py", line 9, in 237s assert [3, 3]==snapshot([3, 5, 3]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_63.py", line 9, in 237s assert [3, 3]==snapshot([3, 5, 3]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py:9: in 237s assert [3, 8]==snapshot([3, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 8]==snapshot([3, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [[3] -> [3, 8, 8] ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py:9: in 237s assert [3, 8, 8]==snapshot([3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 8, 8]==snapshot([3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[3, 2+2] -> [3, 8, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py:9: in 237s assert [3, 8, 4]==snapshot([3, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 8, 4]==snapshot([3, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [[3, 3] -> [3, 8, 3] ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py:9: in 237s assert [3, 8, 3]==snapshot([3, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 8, 3]==snapshot([3, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[3, 2+2, 5] -> [3, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py:9: in 237s assert [3, 4]==snapshot([3, 2+2, 5]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 4]==snapshot([3, 2+2, 5]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[3, 2+2] -> [3, 4, 8] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py:9: in 237s assert [3, 4, 8]==snapshot([3, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 4, 8]==snapshot([3, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py:9: in 237s assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[3, 2+2, 3] -> [3, 4, 3] ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py:9: in 237s assert [3, 4, 3]==snapshot([3, 2+2, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 4, 3]==snapshot([3, 2+2, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [[3, 3, 5] -> [3, 3] ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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])' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_75.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([3, 3, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3, 3]==snapshot([3, 3, 5]) 237s source: assert [3, 3]==snapshot([3, 3, 5]) 237s set(): 237s assert [3, 3]==snapshot([3, 3, 5]) 237s assert [3, 3]==snapshot([3, 3, 5]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([3, 3, 5]) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert [3, 3]==snapshot([3, 3, 5]) 237s {'fix'}: 237s assert [3, 3]==snapshot([3, 3, 5]) 237s assert [3, 3]==snapshot([3, 3]) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3]==snapshot([3, 3, 5]) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_73.py", line 9, in 237s assert [3, 3]==snapshot([3, 3, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_74.py", line 9, in 237s assert [3, 3]==snapshot([3, 3, 5]) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [[3, 3] -> [3, 3, 8] ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py:9: in 237s assert [3, 3, 8]==snapshot([3, 3]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3, 8]==snapshot([3, 3]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [[3, 3, 2+2] -> [3, 3, 4] ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py:9: in 237s assert [3, 3, 4]==snapshot([3, 3, 2+2]) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert [3, 3, 4]==snapshot([3, 3, 2+2]) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5, 5, 5) -> () ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_82.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert ()==snapshot((5, 5, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert ()==snapshot((5, 5, 5)) 237s source: assert ()==snapshot((5, 5, 5)) 237s set(): 237s assert ()==snapshot((5, 5, 5)) 237s assert ()==snapshot((5, 5, 5)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert ()==snapshot((5, 5, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert ()==snapshot((5, 5, 5)) 237s {'fix'}: 237s assert ()==snapshot((5, 5, 5)) 237s assert ()==snapshot(()) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert ()==snapshot((5, 5, 5)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_80.py", line 9, in 237s assert ()==snapshot((5, 5, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_81.py", line 9, in 237s assert ()==snapshot((5, 5, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py:9: in 237s assert (8,)==snapshot((5, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8,)==snapshot((5, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(5, 5, 2+2) -> (4,) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py:9: in 237s assert (4,)==snapshot((5, 5, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4,)==snapshot((5, 5, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(5, 5, 3) -> (3,) ] ____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_87.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((5, 5, 3)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3,)==snapshot((5, 5, 3)) 237s source: assert (3,)==snapshot((5, 5, 3)) 237s set(): 237s assert (3,)==snapshot((5, 5, 3)) 237s assert (3,)==snapshot((5, 5, 3)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((5, 5, 3)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3,)==snapshot((5, 5, 3)) 237s {'fix'}: 237s assert (3,)==snapshot((5, 5, 3)) 237s assert (3,)==snapshot((3,)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((5, 5, 3)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_85.py", line 9, in 237s assert (3,)==snapshot((5, 5, 3)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_86.py", line 9, in 237s assert (3,)==snapshot((5, 5, 3)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py:9: in 237s assert (8,)==snapshot((5, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8,)==snapshot((5, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py:9: in 237s assert (8, 8)==snapshot((5,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 8)==snapshot((5,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py:9: in 237s assert (8, 4)==snapshot((5, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 4)==snapshot((5, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py:9: in 237s assert (8, 3)==snapshot((5, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 3)==snapshot((5, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(5, 2+2, 5) -> (4,) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py:9: in 237s assert (4,)==snapshot((5, 2+2, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4,)==snapshot((5, 2+2, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(5, 2+2) -> (4, 8) ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py:9: in 237s assert (4, 8)==snapshot((5, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 8)==snapshot((5, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(5, 2+2, 2+2) -> (4, 4) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py:9: in 237s assert (4, 4)==snapshot((5, 2+2, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 4)==snapshot((5, 2+2, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(5, 2+2, 3) -> (4, 3) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py:9: in 237s assert (4, 3)==snapshot((5, 2+2, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 3)==snapshot((5, 2+2, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(5, 3, 5) -> (3,) ] ____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_98.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((5, 3, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3,)==snapshot((5, 3, 5)) 237s source: assert (3,)==snapshot((5, 3, 5)) 237s set(): 237s assert (3,)==snapshot((5, 3, 5)) 237s assert (3,)==snapshot((5, 3, 5)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((5, 3, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3,)==snapshot((5, 3, 5)) 237s {'fix'}: 237s assert (3,)==snapshot((5, 3, 5)) 237s assert (3,)==snapshot((3,)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((5, 3, 5)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_96.py", line 9, in 237s assert (3,)==snapshot((5, 3, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_97.py", line 9, in 237s assert (3,)==snapshot((5, 3, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(5, 3) -> (3, 8) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py:9: in 237s assert (3, 8)==snapshot((5, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 8)==snapshot((5, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(5, 3, 2+2) -> (3, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py:9: in 237s assert (3, 4)==snapshot((5, 3, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 4)==snapshot((5, 3, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [(5, 3, 3) -> (3, 3) ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_103.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((5, 3, 3)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3, 3)==snapshot((5, 3, 3)) 237s source: assert (3, 3)==snapshot((5, 3, 3)) 237s set(): 237s assert (3, 3)==snapshot((5, 3, 3)) 237s assert (3, 3)==snapshot((5, 3, 3)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((5, 3, 3)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3, 3)==snapshot((5, 3, 3)) 237s {'fix'}: 237s assert (3, 3)==snapshot((5, 3, 3)) 237s assert (3, 3)==snapshot((3, 3)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((5, 3, 3)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_101.py", line 9, in 237s assert (3, 3)==snapshot((5, 3, 3)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_102.py", line 9, in 237s assert (3, 3)==snapshot((5, 3, 3)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py:9: in 237s assert (8,)==snapshot((5, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8,)==snapshot((5, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py:9: in 237s assert (8, 8)==snapshot((5,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 8)==snapshot((5,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py:9: in 237s assert (8, 4)==snapshot((5, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 4)==snapshot((5, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py:9: in 237s assert (8, 3)==snapshot((5, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 3)==snapshot((5, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py:9: in 237s assert (8, 8)==snapshot((5,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 8)==snapshot((5,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________________ test_generic [() -> (8, 8, 8) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py:9: in 237s assert (8, 8, 8)==snapshot(()) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 8, 8)==snapshot(()) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2,) -> (8, 8, 4) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py:9: in 237s assert (8, 8, 4)==snapshot((2+2,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 8, 4)==snapshot((2+2,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3,) -> (8, 8, 3) ] ____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py:9: in 237s assert (8, 8, 3)==snapshot((3,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 8, 3)==snapshot((3,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2, 5) -> (8, 4) ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py:9: in 237s assert (8, 4)==snapshot((2+2, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 4)==snapshot((2+2, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2,) -> (8, 4, 8) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py:9: in 237s assert (8, 4, 8)==snapshot((2+2,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 4, 8)==snapshot((2+2,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(2+2, 2+2) -> (8, 4, 4) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py:9: in 237s assert (8, 4, 4)==snapshot((2+2, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 4, 4)==snapshot((2+2, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 3) -> (8, 4, 3) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py:9: in 237s assert (8, 4, 3)==snapshot((2+2, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 4, 3)==snapshot((2+2, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3, 5) -> (8, 3) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py:9: in 237s assert (8, 3)==snapshot((3, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 3)==snapshot((3, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3,) -> (8, 3, 8) ] ____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py:9: in 237s assert (8, 3, 8)==snapshot((3,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 3, 8)==snapshot((3,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(3, 2+2) -> (8, 3, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py:9: in 237s assert (8, 3, 4)==snapshot((3, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 3, 4)==snapshot((3, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [(3, 3) -> (8, 3, 3) ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py:9: in 237s assert (8, 3, 3)==snapshot((3, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (8, 3, 3)==snapshot((3, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2, 5, 5) -> (4,) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py:9: in 237s assert (4,)==snapshot((2+2, 5, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4,)==snapshot((2+2, 5, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py:9: in 237s assert (4, 8)==snapshot((2+2, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 8)==snapshot((2+2, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(2+2, 5, 2+2) -> (4, 4) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py:9: in 237s assert (4, 4)==snapshot((2+2, 5, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 4)==snapshot((2+2, 5, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 5, 3) -> (4, 3) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py:9: in 237s assert (4, 3)==snapshot((2+2, 5, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 3)==snapshot((2+2, 5, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py:9: in 237s assert (4, 8)==snapshot((2+2, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 8)==snapshot((2+2, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2,) -> (4, 8, 8) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py:9: in 237s assert (4, 8, 8)==snapshot((2+2,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 8, 8)==snapshot((2+2,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(2+2, 2+2) -> (4, 8, 4) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py:9: in 237s assert (4, 8, 4)==snapshot((2+2, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 8, 4)==snapshot((2+2, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 3) -> (4, 8, 3) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py:9: in 237s assert (4, 8, 3)==snapshot((2+2, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 8, 3)==snapshot((2+2, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(2+2, 2+2, 5) -> (4, 4) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py:9: in 237s assert (4, 4)==snapshot((2+2, 2+2, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 4)==snapshot((2+2, 2+2, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(2+2, 2+2) -> (4, 4, 8) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py:9: in 237s assert (4, 4, 8)==snapshot((2+2, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 4, 8)==snapshot((2+2, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____________ test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] _____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py:9: in 237s assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py:9: in 237s assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 3, 5) -> (4, 3) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py:9: in 237s assert (4, 3)==snapshot((2+2, 3, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 3)==snapshot((2+2, 3, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 3) -> (4, 3, 8) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py:9: in 237s assert (4, 3, 8)==snapshot((2+2, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 3, 8)==snapshot((2+2, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py:9: in 237s assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(2+2, 3, 3) -> (4, 3, 3) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py:9: in 237s assert (4, 3, 3)==snapshot((2+2, 3, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (4, 3, 3)==snapshot((2+2, 3, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3, 5, 5) -> (3,) ] ____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_138.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((3, 5, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3,)==snapshot((3, 5, 5)) 237s source: assert (3,)==snapshot((3, 5, 5)) 237s set(): 237s assert (3,)==snapshot((3, 5, 5)) 237s assert (3,)==snapshot((3, 5, 5)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((3, 5, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3,)==snapshot((3, 5, 5)) 237s {'fix'}: 237s assert (3,)==snapshot((3, 5, 5)) 237s assert (3,)==snapshot((3,)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3,)==snapshot((3, 5, 5)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_136.py", line 9, in 237s assert (3,)==snapshot((3, 5, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_137.py", line 9, in 237s assert (3,)==snapshot((3, 5, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py:9: in 237s assert (3, 8)==snapshot((3, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 8)==snapshot((3, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(3, 5, 2+2) -> (3, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py:9: in 237s assert (3, 4)==snapshot((3, 5, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 4)==snapshot((3, 5, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [(3, 5, 3) -> (3, 3) ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_143.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((3, 5, 3)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3, 3)==snapshot((3, 5, 3)) 237s source: assert (3, 3)==snapshot((3, 5, 3)) 237s set(): 237s assert (3, 3)==snapshot((3, 5, 3)) 237s assert (3, 3)==snapshot((3, 5, 3)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((3, 5, 3)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3, 3)==snapshot((3, 5, 3)) 237s {'fix'}: 237s assert (3, 3)==snapshot((3, 5, 3)) 237s assert (3, 3)==snapshot((3, 3)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((3, 5, 3)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_141.py", line 9, in 237s assert (3, 3)==snapshot((3, 5, 3)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_142.py", line 9, in 237s assert (3, 3)==snapshot((3, 5, 3)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py:9: in 237s assert (3, 8)==snapshot((3, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 8)==snapshot((3, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____________________ test_generic [(3,) -> (3, 8, 8) ] ____________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py:9: in 237s assert (3, 8, 8)==snapshot((3,)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 8, 8)==snapshot((3,)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(3, 2+2) -> (3, 8, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py:9: in 237s assert (3, 8, 4)==snapshot((3, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 8, 4)==snapshot((3, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [(3, 3) -> (3, 8, 3) ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py:9: in 237s assert (3, 8, 3)==snapshot((3, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 8, 3)==snapshot((3, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(3, 2+2, 5) -> (3, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py:9: in 237s assert (3, 4)==snapshot((3, 2+2, 5)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 4)==snapshot((3, 2+2, 5)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(3, 2+2) -> (3, 4, 8) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py:9: in 237s assert (3, 4, 8)==snapshot((3, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 4, 8)==snapshot((3, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] ______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py:9: in 237s assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(3, 2+2, 3) -> (3, 4, 3) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py:9: in 237s assert (3, 4, 3)==snapshot((3, 2+2, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 4, 3)==snapshot((3, 2+2, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [(3, 3, 5) -> (3, 3) ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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))' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_154.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((3, 3, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3, 3)==snapshot((3, 3, 5)) 237s source: assert (3, 3)==snapshot((3, 3, 5)) 237s set(): 237s assert (3, 3)==snapshot((3, 3, 5)) 237s assert (3, 3)==snapshot((3, 3, 5)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((3, 3, 5)) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert (3, 3)==snapshot((3, 3, 5)) 237s {'fix'}: 237s assert (3, 3)==snapshot((3, 3, 5)) 237s assert (3, 3)==snapshot((3, 3)) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3)==snapshot((3, 3, 5)) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_152.py", line 9, in 237s assert (3, 3)==snapshot((3, 3, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_153.py", line 9, in 237s assert (3, 3)==snapshot((3, 3, 5)) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________________ test_generic [(3, 3) -> (3, 3, 8) ] ___________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py:9: in 237s assert (3, 3, 8)==snapshot((3, 3)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 237s new_code = self.context.file._value_to_code(new_value_element) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '8 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3, 8)==snapshot((3, 3)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _______________ test_generic [(3, 3, 2+2) -> (3, 3, 4) ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py:9: in 237s assert (3, 3, 4)==snapshot((3, 3, 2+2)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 237s v = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert (3, 3, 4)==snapshot((3, 3, 2+2)) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ________________ test_generic [{0: 5, 1: 5, 2: 5} -> {} ] _________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_161.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s source: assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s set(): 237s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s {'fix'}: 237s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s assert {}==snapshot({}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_159.py", line 9, in 237s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_160.py", line 9, in 237s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________________ test_generic [{0: 5, 1: 5} -> {2: 8} ] __________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py:9: in 237s assert {2: 8}==snapshot({0: 5, 1: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {2: 8}==snapshot({0: 5, 1: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py:9: in 237s assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_166.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s source: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s set(): 237s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s {'fix'}: 237s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s assert {2: 3}==snapshot({2: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_164.py", line 9, in 237s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_165.py", line 9, in 237s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________________ test_generic [{0: 5, 2: 5} -> {1: 8} ] __________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py:9: in 237s assert {1: 8}==snapshot({0: 5, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 8}==snapshot({0: 5, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________________ test_generic [{0: 5} -> {1: 8, 2: 8} ] __________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py:9: in 237s assert {1: 8, 2: 8}==snapshot({0: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 8, 2: 8}==snapshot({0: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py:9: in 237s assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py:9: in 237s assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py:9: in 237s assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py:9: in 237s assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py:9: in 237s assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py:9: in 237s assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_177.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s source: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s set(): 237s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s {'fix'}: 237s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s assert {1: 3}==snapshot({1: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_175.py", line 9, in 237s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_176.py", line 9, in 237s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py:9: in 237s assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py:9: in 237s assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________ test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] ____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_182.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s source: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s set(): 237s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s {'fix'}: 237s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s assert {1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_180.py", line 9, in 237s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_181.py", line 9, in 237s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________________ test_generic [{1: 5, 2: 5} -> {0: 8} ] __________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py:9: in 237s assert {0: 8}==snapshot({1: 5, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8}==snapshot({1: 5, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________________ test_generic [{1: 5} -> {0: 8, 2: 8} ] __________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py:9: in 237s assert {0: 8, 2: 8}==snapshot({1: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 2: 8}==snapshot({1: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py:9: in 237s assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py:9: in 237s assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________________ test_generic [{2: 5} -> {0: 8, 1: 8} ] __________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py:9: in 237s assert {0: 8, 1: 8}==snapshot({2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 8}==snapshot({2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ________________ test_generic [{} -> {0: 8, 1: 8, 2: 8} ] _________________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py:9: in 237s assert {0: 8, 1: 8, 2: 8}==snapshot({}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 8, 2: 8}==snapshot({}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py:9: in 237s assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py:9: in 237s assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py:9: in 237s assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py:9: in 237s assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py:9: in 237s assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py:9: in 237s assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py:9: in 237s assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py:9: in 237s assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py:9: in 237s assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________ test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] ____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py:9: in 237s assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '0 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py:9: in 237s assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py:9: in 237s assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py:9: in 237s assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py:9: in 237s assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py:9: in 237s assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _________ test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] __________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py:9: in 237s assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py:9: in 237s assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py:9: in 237s assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py:9: in 237s assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py:9: in 237s assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ____ test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] ____ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py:9: in 237s assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] _____ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py:9: in 237s assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py:9: in 237s assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py:9: in 237s assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] _____ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py:9: in 237s assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py:9: in 237s assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_217.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s source: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s set(): 237s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s {'fix'}: 237s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s assert {0: 3}==snapshot({0: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_215.py", line 9, in 237s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_216.py", line 9, in 237s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py:9: in 237s assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py:9: in 237s assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________ test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] ____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_222.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s source: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s set(): 237s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s {'fix'}: 237s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s assert {0: 3, 2: 3}==snapshot({0: 3, 2: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_220.py", line 9, in 237s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_221.py", line 9, in 237s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py:9: in 237s assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______________ test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] _______________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py:9: in 237s assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py:9: in 237s assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________ test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] ____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py:9: in 237s assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py:9: in 237s assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] _______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py:9: in 237s assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s _____ test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] _____ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py:9: in 237s assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py:9: in 237s assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________ test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] ____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s s1 = source(code) 237s print("source:", code) 237s 237s assert set(s1.flags) == flags 237s 237s assert ("fix" in flags) == s1.error 237s 237s for f in all_flags: 237s c3 = build( 237s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 237s ) 237s new_code = f"assert {c2}==snapshot({c3})" 237s 237s print(f"{set(f)}:") 237s print(" ", code) 237s print(" ", new_code) 237s > s2 = s1.run(*f) 237s 237s tests/test_preserve_values.py:245: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:137: in run 237s recorder.fix_all() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s 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})' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_233.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s source: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s set(): 237s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s reported_flags: {'fix'} 237s run: pytest --inline-snapshot= 237s output: 237s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s {'fix'}: 237s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3}) 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_231.py", line 9, in 237s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s Traceback (most recent call last): 237s File "/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py", line 114, in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_232.py", line 9, in 237s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s AssertionError 237s ------------------------------ Captured log call ------------------------------- 237s 237s ___________ test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] ____________ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py:9: in 237s assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 237s self.context.file._value_to_code(k), 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 237s return self._token_to_code(value_to_token(value)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ______ test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] ______ 237s 237s source = .w at 0x3ff8d377740> 237s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x3ff9206fd10>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 237s 237s def test_generic(source, subtests): 237s for braces in ("[]", "()", "{}"): 237s for value_specs in itertools.product(stuff, repeat=3): 237s flags = set().union(*[e[3] for e in value_specs]) 237s all_flags = { 237s frozenset(x) - {""} 237s for x in itertools.combinations_with_replacement( 237s flags | {""}, len(flags) 237s ) 237s } 237s 237s def build(value_lists): 237s value_lists = list(value_lists) 237s 237s if braces == "{}": 237s values = [ 237s f"{i}: {value_list[0]}" 237s for i, value_list in enumerate(value_lists) 237s if value_list 237s ] 237s else: 237s values = [x for value_list in value_lists for x in value_list] 237s 237s code = ", ".join(values) 237s 237s comma = "" 237s if len(values) == 1 and braces == "()": 237s comma = "," 237s 237s return f"{braces[0]}{code}{comma}{braces[1]}" 237s 237s c1 = build(spec[0] for spec in value_specs) 237s c2 = build(spec[1] for spec in value_specs) 237s code = f"assert {c2}==snapshot({c1})" 237s 237s named_flags = ", ".join(flags) 237s 237s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 237s > s1 = source(code) 237s 237s tests/test_preserve_values.py:229: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py:9: in 237s assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 237s result[key] = yield from self.get_adapter( 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 237s ------------------------------ Captured log call ------------------------------- 237s 237s ________________________ test_pydantic_create_snapshot _________________________ 237s 237s def test_pydantic_create_snapshot(): 237s 237s Example( 237s """ 237s from pydantic import BaseModel 237s from inline_snapshot import snapshot 237s 237s class M(BaseModel): 237s size:int 237s name:str 237s age:int=4 237s 237s def test_pydantic(): 237s m=M(size=5,name="Tom") 237s assert m==snapshot() 237s assert m.dict()==snapshot() 237s 237s """ 237s > ).run_pytest( 237s ["--inline-snapshot=create"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s 237s from pydantic import BaseModel 237s from inline_snapshot import snapshot 237s 237s class M(BaseModel): 237s size:int 237s name:str 237s age:int=4 237s 237s def test_pydantic(): 237s m=M(size=5,name="Tom") 237s assert m==snapshot(M(size=5, name="Tom")) 237s assert m.dict()==snapshot({"size": 5, "name": "Tom", "age": 4}) 237s 237s \ 237s """ 237s } 237s ), 237s ).run_pytest( 237s ["--inline-snapshot=disable"] 237s ) 237s 237s tests/test_pydantic.py:23: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--inline-snapshot=create'] 237s 237s def run_pytest( 237s self, 237s args: list[str] = [], 237s *, 237s term_columns=80, 237s env: dict[str, str] = {}, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s stderr: Snapshot[str] | None = None, 237s returncode: Snapshot[int] | None = None, 237s ) -> Example: 237s """Run pytest with the given args and env variables in an seperate 237s process. 237s 237s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 237s 237s Parameters: 237s args: pytest arguments like "--inline-snapshot=fix" 237s env: dict of environment variables 237s changed_files: snapshot of files which are changed by this run. 237s report: snapshot of the report at the end of the pytest run. 237s stderr: pytest stderr output 237s returncode: snapshot of the pytest returncode. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s self._write_files(tmp_path) 237s 237s cmd = [sys.executable, "-m", "pytest", *args] 237s 237s command_env = dict(os.environ) 237s command_env["TERM"] = "unknown" 237s command_env["COLUMNS"] = str( 237s term_columns + 1 if platform.system() == "Windows" else term_columns 237s ) 237s command_env.pop("CI", None) 237s 237s command_env.update(env) 237s 237s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 237s 237s print("run>", *cmd) 237s print("stdout:") 237s print(result.stdout.decode()) 237s print("stderr:") 237s print(result.stderr.decode()) 237s 237s if returncode is not None: 237s assert result.returncode == returncode 237s 237s if stderr is not None: 237s assert result.stderr.decode() == stderr 237s 237s if report is not None: 237s 237s report_list = [] 237s record = False 237s for line in result.stdout.decode().splitlines(): 237s line = line.strip() 237s if line.startswith("===="): 237s record = False 237s 237s if record and line: 237s report_list.append(line) 237s 237s if line.startswith("====") and "inline snapshot" in line: 237s record = True 237s 237s report_str = "\n".join(report_list) 237s 237s assert normalize(report_str) == report, repr(report_str) 237s 237s if changed_files is not None: 237s current_files = {} 237s 237s for name, content in sorted(self._read_files(tmp_path).items()): 237s if name not in self.files or self.files[name] != content: 237s current_files[name] = content 237s > assert changed_files == current_files 237s E AssertionError: assert {'test_someth... 4})\n\n '} == {} 237s E 237s E Left contains 1 more item: 237s E {'test_something.py': '\n' 237s E 'from pydantic import BaseModel\n' 237s E 'from inline_snapshot import snapshot\n' 237s E '\n' 237s E 'class M(BaseModel):\n'... 237s E 237s E ...Full output truncated (12 lines hidden), use '-vv' to show 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s 237s from pydantic import BaseModel 237s from inline_snapshot import snapshot 237s 237s class M(BaseModel): 237s size:int 237s name:str 237s age:int=4 237s 237s def test_pydantic(): 237s m=M(size=5,name="Tom") 237s assert m==snapshot() 237s assert m.dict()==snapshot() 237s 237s 237s 237s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmpaflag6j5 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_something.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ________________________________ test_pydantic _________________________________ 237s 237s def test_pydantic(): 237s m=M(size=5,name="Tom") 237s > assert m==snapshot() 237s 237s test_something.py:12: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '', filename = PosixPath('/tmp/tmpaflag6j5/test_something.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 237s ============================== 1 failed in 0.33s =============================== 237s 237s stderr: 237s 237s ___________________________ test_pydantic_field_repr ___________________________ 237s 237s def test_pydantic_field_repr(): 237s 237s Example( 237s """\ 237s from inline_snapshot import snapshot 237s from pydantic import BaseModel,Field 237s 237s class container(BaseModel): 237s a: int 237s b: int = Field(default=5,repr=False) 237s 237s assert container(a=1,b=5) == snapshot() 237s """ 237s > ).run_pytest( 237s ["--inline-snapshot=create"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s from inline_snapshot import snapshot 237s from pydantic import BaseModel,Field 237s 237s class container(BaseModel): 237s a: int 237s b: int = Field(default=5,repr=False) 237s 237s assert container(a=1,b=5) == snapshot(container(a=1)) 237s """ 237s } 237s ), 237s ).run_pytest( 237s ["--inline-snapshot=disable"] 237s ) 237s 237s tests/test_pydantic.py:64: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--inline-snapshot=create'] 237s 237s def run_pytest( 237s self, 237s args: list[str] = [], 237s *, 237s term_columns=80, 237s env: dict[str, str] = {}, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s stderr: Snapshot[str] | None = None, 237s returncode: Snapshot[int] | None = None, 237s ) -> Example: 237s """Run pytest with the given args and env variables in an seperate 237s process. 237s 237s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 237s 237s Parameters: 237s args: pytest arguments like "--inline-snapshot=fix" 237s env: dict of environment variables 237s changed_files: snapshot of files which are changed by this run. 237s report: snapshot of the report at the end of the pytest run. 237s stderr: pytest stderr output 237s returncode: snapshot of the pytest returncode. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s self._write_files(tmp_path) 237s 237s cmd = [sys.executable, "-m", "pytest", *args] 237s 237s command_env = dict(os.environ) 237s command_env["TERM"] = "unknown" 237s command_env["COLUMNS"] = str( 237s term_columns + 1 if platform.system() == "Windows" else term_columns 237s ) 237s command_env.pop("CI", None) 237s 237s command_env.update(env) 237s 237s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 237s 237s print("run>", *cmd) 237s print("stdout:") 237s print(result.stdout.decode()) 237s print("stderr:") 237s print(result.stderr.decode()) 237s 237s if returncode is not None: 237s assert result.returncode == returncode 237s 237s if stderr is not None: 237s assert result.stderr.decode() == stderr 237s 237s if report is not None: 237s 237s report_list = [] 237s record = False 237s for line in result.stdout.decode().splitlines(): 237s line = line.strip() 237s if line.startswith("===="): 237s record = False 237s 237s if record and line: 237s report_list.append(line) 237s 237s if line.startswith("====") and "inline snapshot" in line: 237s record = True 237s 237s report_str = "\n".join(report_list) 237s 237s assert normalize(report_str) == report, repr(report_str) 237s 237s if changed_files is not None: 237s current_files = {} 237s 237s for name, content in sorted(self._read_files(tmp_path).items()): 237s if name not in self.files or self.files[name] != content: 237s current_files[name] = content 237s > assert changed_files == current_files 237s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 237s E 237s E Left contains 1 more item: 237s E {'test_something.py': 'from inline_snapshot import snapshot\n' 237s E 'from pydantic import BaseModel,Field\n' 237s E '\n' 237s E 'class container(BaseModel):\n' 237s E ' a: int\n'... 237s E 237s E ...Full output truncated (4 lines hidden), use '-vv' to show 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s from inline_snapshot import snapshot 237s from pydantic import BaseModel,Field 237s 237s class container(BaseModel): 237s a: int 237s b: int = Field(default=5,repr=False) 237s 237s assert container(a=1,b=5) == snapshot() 237s 237s 237s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmp84ld6a_8 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 0 items / 1 error 237s 237s ==================================== ERRORS ==================================== 237s ______________________ ERROR collecting test_something.py ______________________ 237s test_something.py:8: in 237s assert container(a=1,b=5) == snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 237s runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 237s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 237s =============================== 1 error in 0.41s =============================== 237s 237s stderr: 237s 237s _________________________ test_pydantic_default_value __________________________ 237s 237s def test_pydantic_default_value(): 237s Example( 237s """\ 237s from inline_snapshot import snapshot,Is 237s from dataclasses import dataclass,field 237s from pydantic import BaseModel,Field 237s 237s class A(BaseModel): 237s a:int 237s b:int=2 237s c:list=Field(default_factory=list) 237s 237s def test_something(): 237s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 237s """ 237s > ).run_pytest( 237s ["--inline-snapshot=update"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s from inline_snapshot import snapshot,Is 237s from dataclasses import dataclass,field 237s from pydantic import BaseModel,Field 237s 237s class A(BaseModel): 237s a:int 237s b:int=2 237s c:list=Field(default_factory=list) 237s 237s def test_something(): 237s assert A(a=1) == snapshot(A(a=1)) 237s """ 237s } 237s ), 237s ) 237s 237s tests/test_pydantic.py:100: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--inline-snapshot=update'] 237s 237s def run_pytest( 237s self, 237s args: list[str] = [], 237s *, 237s term_columns=80, 237s env: dict[str, str] = {}, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s stderr: Snapshot[str] | None = None, 237s returncode: Snapshot[int] | None = None, 237s ) -> Example: 237s """Run pytest with the given args and env variables in an seperate 237s process. 237s 237s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 237s 237s Parameters: 237s args: pytest arguments like "--inline-snapshot=fix" 237s env: dict of environment variables 237s changed_files: snapshot of files which are changed by this run. 237s report: snapshot of the report at the end of the pytest run. 237s stderr: pytest stderr output 237s returncode: snapshot of the pytest returncode. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s self._write_files(tmp_path) 237s 237s cmd = [sys.executable, "-m", "pytest", *args] 237s 237s command_env = dict(os.environ) 237s command_env["TERM"] = "unknown" 237s command_env["COLUMNS"] = str( 237s term_columns + 1 if platform.system() == "Windows" else term_columns 237s ) 237s command_env.pop("CI", None) 237s 237s command_env.update(env) 237s 237s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 237s 237s print("run>", *cmd) 237s print("stdout:") 237s print(result.stdout.decode()) 237s print("stderr:") 237s print(result.stderr.decode()) 237s 237s if returncode is not None: 237s assert result.returncode == returncode 237s 237s if stderr is not None: 237s assert result.stderr.decode() == stderr 237s 237s if report is not None: 237s 237s report_list = [] 237s record = False 237s for line in result.stdout.decode().splitlines(): 237s line = line.strip() 237s if line.startswith("===="): 237s record = False 237s 237s if record and line: 237s report_list.append(line) 237s 237s if line.startswith("====") and "inline snapshot" in line: 237s record = True 237s 237s report_str = "\n".join(report_list) 237s 237s assert normalize(report_str) == report, repr(report_str) 237s 237s if changed_files is not None: 237s current_files = {} 237s 237s for name, content in sorted(self._read_files(tmp_path).items()): 237s if name not in self.files or self.files[name] != content: 237s current_files[name] = content 237s > assert changed_files == current_files 237s E AssertionError: assert {'test_someth...ot(A(a=1))\n'} == {} 237s E 237s E Left contains 1 more item: 237s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 237s E 'from dataclasses import dataclass,field\n' 237s E 'from pydantic import BaseModel,Field\n' 237s E '\n' 237s E 'class A(BaseModel):\n'... 237s E 237s E ...Full output truncated (7 lines hidden), use '-vv' to show 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s from inline_snapshot import snapshot,Is 237s from dataclasses import dataclass,field 237s from pydantic import BaseModel,Field 237s 237s class A(BaseModel): 237s a:int 237s b:int=2 237s c:list=Field(default_factory=list) 237s 237s def test_something(): 237s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 237s 237s 237s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmp3_rhhmed 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_something.py . [100%] 237s =============================== inline snapshot ================================ 237s ─────────────────────────────── Update snapshots ─────────────────────────────── 237s 237s stderr: 237s Traceback (most recent call last): 237s File "", line 198, in _run_module_as_main 237s File "", line 88, in _run_code 237s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 237s raise SystemExit(pytest.console_main()) 237s ^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 237s code = main() 237s ^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 237s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 237s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 237s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 237s raise exception.with_traceback(exception.__traceback__) 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 237s res = hook_impl.function(*args) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 237s return wrap_session(config, _main) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 237s config.hook.pytest_sessionfinish( 237s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 237s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 237s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 237s raise exception.with_traceback(exception.__traceback__) 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 237s teardown.throw(exception) # type: ignore[union-attr] 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 237s return (yield) 237s ^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 237s teardown.send(result) # type: ignore[union-attr] 237s ^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 237s self.config.hook.pytest_terminal_summary( 237s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 237s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 237s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 237s raise exception.with_traceback(exception.__traceback__) 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 237s teardown.throw(exception) # type: ignore[union-attr] 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 237s return (yield) 237s ^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 237s teardown.throw(exception) # type: ignore[union-attr] 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 237s return (yield) 237s ^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 237s res = hook_impl.function(*args) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 237s diff = file.diff() 237s ^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 237s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 237s ^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s ^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 237s runner = CliRunner(mix_stderr=False) 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s _________________________ test_pydantic_factory_method _________________________ 237s 237s def test_pydantic_factory_method(): 237s Example( 237s """\ 237s from inline_snapshot import snapshot 237s from pydantic import BaseModel 237s 237s class A(BaseModel): 237s a:int 237s 237s @classmethod 237s def from_str(cls,s): 237s return cls(a=int(s)) 237s 237s def test_something(): 237s for a in [1,2]: 237s assert A(a=2) == snapshot(A.from_str("1")) 237s """ 237s > ).run_pytest( 237s ["--inline-snapshot=fix"], 237s changed_files=snapshot( 237s { 237s "test_something.py": """\ 237s from inline_snapshot import snapshot 237s from pydantic import BaseModel 237s 237s class A(BaseModel): 237s a:int 237s 237s @classmethod 237s def from_str(cls,s): 237s return cls(a=int(s)) 237s 237s def test_something(): 237s for a in [1,2]: 237s assert A(a=2) == snapshot(A(a=2)) 237s """ 237s } 237s ), 237s ) 237s 237s tests/test_pydantic.py:157: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--inline-snapshot=fix'] 237s 237s def run_pytest( 237s self, 237s args: list[str] = [], 237s *, 237s term_columns=80, 237s env: dict[str, str] = {}, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s stderr: Snapshot[str] | None = None, 237s returncode: Snapshot[int] | None = None, 237s ) -> Example: 237s """Run pytest with the given args and env variables in an seperate 237s process. 237s 237s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 237s 237s Parameters: 237s args: pytest arguments like "--inline-snapshot=fix" 237s env: dict of environment variables 237s changed_files: snapshot of files which are changed by this run. 237s report: snapshot of the report at the end of the pytest run. 237s stderr: pytest stderr output 237s returncode: snapshot of the pytest returncode. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s self._write_files(tmp_path) 237s 237s cmd = [sys.executable, "-m", "pytest", *args] 237s 237s command_env = dict(os.environ) 237s command_env["TERM"] = "unknown" 237s command_env["COLUMNS"] = str( 237s term_columns + 1 if platform.system() == "Windows" else term_columns 237s ) 237s command_env.pop("CI", None) 237s 237s command_env.update(env) 237s 237s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 237s 237s print("run>", *cmd) 237s print("stdout:") 237s print(result.stdout.decode()) 237s print("stderr:") 237s print(result.stderr.decode()) 237s 237s if returncode is not None: 237s assert result.returncode == returncode 237s 237s if stderr is not None: 237s assert result.stderr.decode() == stderr 237s 237s if report is not None: 237s 237s report_list = [] 237s record = False 237s for line in result.stdout.decode().splitlines(): 237s line = line.strip() 237s if line.startswith("===="): 237s record = False 237s 237s if record and line: 237s report_list.append(line) 237s 237s if line.startswith("====") and "inline snapshot" in line: 237s record = True 237s 237s report_str = "\n".join(report_list) 237s 237s assert normalize(report_str) == report, repr(report_str) 237s 237s if changed_files is not None: 237s current_files = {} 237s 237s for name, content in sorted(self._read_files(tmp_path).items()): 237s if name not in self.files or self.files[name] != content: 237s current_files[name] = content 237s > assert changed_files == current_files 237s E AssertionError: assert {'test_someth...ot(A(a=2))\n'} == {} 237s E 237s E Left contains 1 more item: 237s E {'test_something.py': 'from inline_snapshot import snapshot\n' 237s E 'from pydantic import BaseModel\n' 237s E '\n' 237s E 'class A(BaseModel):\n' 237s E ' a:int\n'... 237s E 237s E ...Full output truncated (9 lines hidden), use '-vv' to show 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s from inline_snapshot import snapshot 237s from pydantic import BaseModel 237s 237s class A(BaseModel): 237s a:int 237s 237s @classmethod 237s def from_str(cls,s): 237s return cls(a=int(s)) 237s 237s def test_something(): 237s for a in [1,2]: 237s assert A(a=2) == snapshot(A.from_str("1")) 237s 237s 237s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmpyd16k68y 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_something.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ________________________________ test_something ________________________________ 237s 237s def test_something(): 237s for a in [1,2]: 237s > assert A(a=2) == snapshot(A.from_str("1")) 237s 237s test_something.py:13: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 237s result = yield from self.value_assign(old_value, old_node, new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 237s result = yield from adapter.assign(old_value, old_node, new_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = 'A (a =2 )', filename = PosixPath('/tmp/tmpyd16k68y/test_something.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 237s ============================== 1 failed in 0.28s =============================== 237s 237s stderr: 237s 237s __________________________________ test_pypy ___________________________________ 237s 237s @pytest.mark.no_rewriting 237s def test_pypy(): 237s report = ( 237s snapshot("INFO: inline-snapshot was disabled because pypy is not supported") 237s if sys.implementation.name == "pypy" 237s else snapshot( 237s """\ 237s -------------------------------- Fix snapshots --------------------------------- 237s +----------------------------- test_something.py ------------------------------+ 237s | @@ -1,6 +1,6 @@ | 237s | | 237s | from inline_snapshot import snapshot | 237s | | 237s | def test_example(): | 237s | - assert 1+1==snapshot(3) | 237s | + assert 1+1==snapshot(2) | 237s +------------------------------------------------------------------------------+ 237s These changes will be applied, because you used --inline-snapshot=fix\ 237s """ 237s ) 237s ) 237s 237s Example( 237s """\ 237s from inline_snapshot import snapshot 237s 237s def test_example(): 237s assert 1+1==snapshot(3) 237s 237s """ 237s > ).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( 237s ["--inline-snapshot=disable"], report="" 237s ) 237s 237s tests/test_pypy.py:38: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 237s assert normalize(report_str) == report, repr(report_str) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "''" 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pypy.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_something.py 237s from inline_snapshot import snapshot 237s 237s def test_example(): 237s assert 1+1==snapshot(3) 237s 237s 237s 237s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmptt2lmo7k 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_something.py F [100%] 237s 237s =================================== FAILURES =================================== 237s _________________________________ test_example _________________________________ 237s 237s def test_example(): 237s > assert 1+1==snapshot(3) 237s 237s test_something.py:4: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ', filename = PosixPath('/tmp/tmptt2lmo7k/test_something.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_something.py::test_example - TypeError: CliRunner.__init__() got ... 237s ============================== 1 failed in 0.19s =============================== 237s 237s stderr: 237s 237s _________________________________ test_create __________________________________ 237s 237s project = .Project object at 0x3ff8c705370> 237s 237s def test_create(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert 5==snapshot() 237s """ 237s ) 237s 237s result = project.run() 237s 237s > result.assert_outcomes(errors=1, passed=1) 237s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 237s E 237s E Omitting 4 identical items, use -vv to show 237s E Differing items: 237s E {'passed': 0} != {'passed': 1} 237s E {'failed': 1} != {'failed': 0} 237s E Use -v to get more diff 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:24: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert 5==snapshot() 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_create0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_create0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py FE [100%] 237s 237s ==================================== ERRORS ==================================== 237s _________________________ ERROR at teardown of test_a __________________________ 237s your snapshot is missing one value. 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert 5==snapshot() 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_create0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 237s ========================== 1 failed, 1 error in 0.22s ========================== 237s ___________________________________ test_fix ___________________________________ 237s 237s project = .Project object at 0x3ff8c705df0> 237s 237s def test_fix(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert 5==snapshot(4) 237s """ 237s ) 237s 237s result = project.run() 237s 237s > result.assert_outcomes(failed=1, errors=1) 237s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 237s E 237s E Omitting 5 identical items, use -vv to show 237s E Differing items: 237s E {'errors': 0} != {'errors': 1} 237s E Use -v to get more diff 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:71: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert 5==snapshot(4) 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert 5==snapshot(4) 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '5 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ============================== 1 failed in 0.29s =============================== 237s _________________________________ test_update __________________________________ 237s 237s project = .Project object at 0x3ff8c706cf0> 237s 237s def test_update(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert "5" == snapshot('''5''') 237s """ 237s ) 237s 237s result = project.run() 237s 237s > result.assert_outcomes(passed=1) 237s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 237s E 237s E Omitting 4 identical items, use -vv to show 237s E Differing items: 237s E {'passed': 0} != {'passed': 1} 237s E {'failed': 1} != {'failed': 0} 237s E Use -v to get more diff 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:118: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert "5" == snapshot('''5''') 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_update0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_update0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert "5" == snapshot('''5''') 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "'5'" 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_update0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ============================== 1 failed in 0.21s =============================== 237s __________________________________ test_trim ___________________________________ 237s 237s project = .Project object at 0x3ff8c707f80> 237s 237s def test_trim(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert 5 in snapshot([4,5]) 237s """ 237s ) 237s 237s result = project.run() 237s 237s result.assert_outcomes(passed=1) 237s 237s assert result.report == snapshot( 237s """\ 237s Info: one snapshot can be trimmed (--inline-snapshot=trim) 237s You can also use --inline-snapshot=review to approve the changes interactively 237s """ 237s ) 237s 237s result = project.run("--inline-snapshot=trim") 237s 237s > assert result.report == snapshot( 237s """\ 237s -------------------------------- Trim snapshots -------------------------------- 237s +-------------------------------- test_file.py --------------------------------+ 237s | @@ -4,4 +4,4 @@ | 237s | | 237s | | 237s | | 237s | def test_a(): | 237s | - assert 5 in snapshot([4,5]) | 237s | + assert 5 in snapshot([5]) | 237s +------------------------------------------------------------------------------+ 237s These changes will be applied, because you used --inline-snapshot=trim 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:178: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "'-------------------------------- Trim snapshots --------------------------------'" 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert 5 in snapshot([4,5]) 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py . [100%] 237s =============================== inline snapshot ================================ 237s Info: one snapshot can be trimmed (--inline-snapshot=trim) 237s 237s You can also use --inline-snapshot=review to approve the changes interactively 237s 237s ============================== 1 passed in 0.16s =============================== 237s running: pytest --inline-snapshot=trim 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py . [100%] 237s =============================== inline snapshot ================================ 237s ──────────────────────────────── Trim snapshots ──────────────────────────────── 237s ----------------------------- Captured stderr call ----------------------------- 237s Traceback (most recent call last): 237s File "/usr/bin/pytest", line 8, in 237s sys.exit(console_main()) 237s ~~~~~~~~~~~~^^ 237s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 237s code = main() 237s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 237s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 237s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 237s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 237s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 237s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 237s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 237s raise exception.with_traceback(exception.__traceback__) 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 237s res = hook_impl.function(*args) 237s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 237s return wrap_session(config, _main) 237s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 237s config.hook.pytest_sessionfinish( 237s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 237s session=session, exitstatus=session.exitstatus 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s ) 237s ^ 237s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 237s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 237s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 237s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 237s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 237s raise exception.with_traceback(exception.__traceback__) 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 237s teardown.throw(exception) # type: ignore[union-attr] 237s ~~~~~~~~~~~~~~^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 237s return (yield) 237s ^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 237s teardown.send(result) # type: ignore[union-attr] 237s ~~~~~~~~~~~~~^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 237s self.config.hook.pytest_terminal_summary( 237s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 237s terminalreporter=self, exitstatus=exitstatus, config=self.config 237s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s ) 237s ^ 237s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 237s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 237s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 237s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 237s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 237s raise exception.with_traceback(exception.__traceback__) 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 237s teardown.throw(exception) # type: ignore[union-attr] 237s ~~~~~~~~~~~~~~^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 237s return (yield) 237s ^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 237s teardown.throw(exception) # type: ignore[union-attr] 237s ~~~~~~~~~~~~~~^^^^^^^^^^^ 237s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 237s return (yield) 237s ^^^^^ 237s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 237s res = hook_impl.function(*args) 237s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 237s diff = file.diff() 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 237s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 237s ~~~~~~~~~~~~~^^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s ~~~~~~~~~~~^ 237s code, self.filename 237s ^^^^^^^^^^^^^^^^^^^ 237s ) 237s ^ 237s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 237s runner = CliRunner(mix_stderr=False) 237s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s ________________________________ test_multiple _________________________________ 237s 237s project = .Project object at 0x3ff8c6f77a0> 237s 237s def test_multiple(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert "5" == snapshot('''5''') 237s assert 5 <= snapshot(8) 237s assert 5 == snapshot(4) 237s """ 237s ) 237s 237s result = project.run() 237s 237s > result.assert_outcomes(failed=1, errors=1) 237s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 237s E 237s E Omitting 5 identical items, use -vv to show 237s E Differing items: 237s E {'errors': 0} != {'errors': 1} 237s E Use -v to get more diff 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:214: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert "5" == snapshot('''5''') 237s assert 5 <= snapshot(8) 237s assert 5 == snapshot(4) 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert "5" == snapshot('''5''') 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "'5'" 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ============================== 1 failed in 0.26s =============================== 237s _____________________________ test_multiple_report _____________________________ 237s 237s project = .Project object at 0x3ff8c580ce0> 237s 237s def test_multiple_report(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert "5" == snapshot('''5''') 237s assert 5 <= snapshot(8) 237s assert 5 == snapshot(4) 237s """ 237s ) 237s 237s result = project.run("--inline-snapshot=trim,report") 237s 237s > assert result.report == snapshot( 237s """\ 237s -------------------------------- Fix snapshots --------------------------------- 237s +-------------------------------- test_file.py --------------------------------+ 237s | @@ -6,4 +6,4 @@ | 237s | | 237s | def test_a(): | 237s | assert "5" == snapshot('''5''') | 237s | assert 5 <= snapshot(8) | 237s | - assert 5 == snapshot(4) | 237s | + assert 5 == snapshot(5) | 237s +------------------------------------------------------------------------------+ 237s These changes are not applied. 237s Use --inline-snapshot=fix to apply them, or use the interactive mode with 237s --inline-snapshot=review 237s -------------------------------- Trim snapshots -------------------------------- 237s +-------------------------------- test_file.py --------------------------------+ 237s | @@ -5,5 +5,5 @@ | 237s | | 237s | | 237s | def test_a(): | 237s | assert "5" == snapshot('''5''') | 237s | - assert 5 <= snapshot(8) | 237s | + assert 5 <= snapshot(5) | 237s | assert 5 == snapshot(4) | 237s +------------------------------------------------------------------------------+ 237s These changes will be applied, because you used --inline-snapshot=trim 237s ------------------------------- Update snapshots ------------------------------- 237s +-------------------------------- test_file.py --------------------------------+ 237s | @@ -4,6 +4,6 @@ | 237s | | 237s | | 237s | | 237s | def test_a(): | 237s | - assert "5" == snapshot('''5''') | 237s | + assert "5" == snapshot("5") | 237s | assert 5 <= snapshot(5) | 237s | assert 5 == snapshot(4) | 237s +------------------------------------------------------------------------------+ 237s These changes are not applied. 237s Use --inline-snapshot=update to apply them, or use the interactive mode with 237s --inline-snapshot=review 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:307: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "''" 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert "5" == snapshot('''5''') 237s assert 5 <= snapshot(8) 237s assert 5 == snapshot(4) 237s 237s running: pytest --inline-snapshot=trim,report 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert "5" == snapshot('''5''') 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "'5'" 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ============================== 1 failed in 0.29s =============================== 237s ______________________________ test_black_config _______________________________ 237s 237s project = .Project object at 0x3ff8c583ad0> 237s 237s def test_black_config(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert list(range(10)) == snapshot([]) 237s """ 237s ) 237s 237s > project.format() 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:370: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/conftest.py:315: in format 237s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\n\n\ndef test_a():\n assert list(range(10)) == snapshot([])\n' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_black_config0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert list(range(10)) == snapshot([]) 237s 237s ________________________________ test_disabled _________________________________ 237s 237s project = .Project object at 0x3ff8c582840> 237s 237s def test_disabled(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert 4==snapshot(5) 237s """ 237s ) 237s 237s result = project.run("--inline-snapshot=disable") 237s result.assert_outcomes(failed=1) 237s 237s result = project.run("--inline-snapshot=fix") 237s > assert project.source == snapshot( 237s """\ 237s def test_a(): 237s assert 4==snapshot(4) 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:409: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\ndef test_a():\n assert 4==snapshot(5)\n"""' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert 4==snapshot(5) 237s 237s running: pytest --inline-snapshot=disable 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert 4==snapshot(5) 237s E assert 4 == 5 237s E + where 5 = snapshot(5) 237s 237s test_file.py:7: AssertionError 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - assert 4 == 5 237s ============================== 1 failed in 0.13s =============================== 237s running: pytest --inline-snapshot=fix 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert 4==snapshot(5) 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '4 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_disabled0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ============================== 1 failed in 0.19s =============================== 237s _________________________________ test_compare _________________________________ 237s 237s project = .Project object at 0x3ff8c5f6060> 237s 237s def test_compare(project): 237s project.setup( 237s """\ 237s def test_a(): 237s assert "a"==snapshot("b") 237s """ 237s ) 237s 237s result = project.run() 237s > assert result.errorLines() == snapshot( 237s """\ 237s > assert "a"==snapshot("b") 237s E AssertionError: assert 'a' == 'b' 237s E ⏎ 237s E - b 237s E + a 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:429: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\n> assert "a"==snapshot("b")\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_a(): 237s assert "a"==snapshot("b") 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert "a"==snapshot("b") 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "'a'" 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_compare0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 237s ============================== 1 failed in 0.22s =============================== 237s __________________________ test_assertion_error_loop ___________________________ 237s 237s project = .Project object at 0x3ff8c862090> 237s 237s def test_assertion_error_loop(project): 237s project.setup( 237s """\ 237s for e in (1, 2): 237s assert e == snapshot() 237s """ 237s ) 237s result = project.run() 237s > assert result.errorLines() == snapshot( 237s """\ 237s E assert 2 == 1 237s E + where 1 = snapshot() 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:466: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s for e in (1, 2): 237s assert e == snapshot() 237s 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 0 items / 1 error 237s 237s ==================================== ERRORS ==================================== 237s ________________________ ERROR collecting test_file.py _________________________ 237s test_file.py:7: in 237s assert e == snapshot() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 237s runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 237s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 237s =============================== 1 error in 0.20s =============================== 237s _____________________________ test_assertion_error _____________________________ 237s 237s project = .Project object at 0x3ff8c5f6b70> 237s 237s def test_assertion_error(project): 237s project.setup("assert 2 == snapshot(1)") 237s result = project.run() 237s > assert result.errorLines() == snapshot( 237s """\ 237s E assert 2 == 1 237s E + where 1 = snapshot(1) 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:493: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s assert 2 == snapshot(1) 237s running: pytest 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 0 items / 1 error 237s 237s ==================================== ERRORS ==================================== 237s ________________________ ERROR collecting test_file.py _________________________ 237s test_file.py:6: in 237s assert 2 == snapshot(1) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 237s runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 237s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 237s =============================== 1 error in 0.18s =============================== 237s _______________________ test_pytest_inlinesnapshot_auto ________________________ 237s 237s project = .Project object at 0x3ff8c5f6660> 237s 237s def test_pytest_inlinesnapshot_auto(project): 237s project.setup( 237s """\ 237s def test_something(): 237s assert 2 == snapshot(1) 237s """ 237s ) 237s result = project.run("--inline-snapshot=review", stdin=b"y\n") 237s > assert result.errorLines() == snapshot("") 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:526: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\n> assert 2 == snapshot(1)\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s def test_something(): 237s assert 2 == snapshot(1) 237s 237s running: pytest --inline-snapshot=review 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ________________________________ test_something ________________________________ 237s 237s def test_something(): 237s > assert 2 == snapshot(1) 237s 237s test_file.py:7: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '2 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 237s ============================== 1 failed in 0.21s =============================== 237s ________________________ test_persist_unknown_external _________________________ 237s 237s project = .Project object at 0x3ff8c5cbe00> 237s 237s def test_persist_unknown_external(project): 237s project.setup( 237s """\ 237s from inline_snapshot import external, snapshot 237s 237s def test_sub_snapshot(): 237s external("123*.png") 237s assert 1==snapshot(2) 237s """ 237s ) 237s 237s result = project.run("--inline-snapshot=fix") 237s 237s > assert project.source == snapshot( 237s """\ 237s from inline_snapshot import external, snapshot 237s 237s def test_sub_snapshot(): 237s external("123*.png") 237s assert 1==snapshot(1) 237s """ 237s ) 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:596: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\nfrom inline_snapshot import external, snapshot\n\ndef test_sub_snapshot():\n external("123*.png")\n assert 1==snapshot(2)\n"""' 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s from inline_snapshot import external, snapshot 237s 237s def test_sub_snapshot(): 237s external("123*.png") 237s assert 1==snapshot(2) 237s 237s running: pytest --inline-snapshot=fix 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ______________________________ test_sub_snapshot _______________________________ 237s 237s def test_sub_snapshot(): 237s external("123*.png") 237s > assert 1==snapshot(2) 237s 237s test_file.py:8: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_sub_snapshot - TypeError: CliRunner.__init__() got ... 237s ============================== 1 failed in 0.22s =============================== 237s ___________________________ test_diff_multiple_files ___________________________ 237s 237s def test_diff_multiple_files(): 237s 237s Example( 237s { 237s "test_a.py": """ 237s from inline_snapshot import snapshot 237s 237s def test_a(): 237s assert 1==snapshot(2) 237s """, 237s "test_b.py": """ 237s from inline_snapshot import snapshot 237s 237s def test_b(): 237s assert 1==snapshot() 237s """, 237s } 237s > ).run_pytest( 237s ["--inline-snapshot=create,fix"], 237s changed_files=snapshot( 237s { 237s "test_b.py": """\ 237s 237s from inline_snapshot import snapshot 237s 237s def test_b(): 237s assert 1==snapshot(1) 237s \ 237s """, 237s "test_a.py": """\ 237s 237s from inline_snapshot import snapshot 237s 237s def test_a(): 237s assert 1==snapshot(1) 237s \ 237s """, 237s } 237s ), 237s report=snapshot( 237s """\ 237s ------------------------------- Create snapshots ------------------------------- 237s +--------------------------------- test_b.py ----------------------------------+ 237s | @@ -2,5 +2,5 @@ | 237s | | 237s | from inline_snapshot import snapshot | 237s | | 237s | def test_b(): | 237s | - assert 1==snapshot() | 237s | + assert 1==snapshot(1) | 237s +------------------------------------------------------------------------------+ 237s These changes will be applied, because you used --inline-snapshot=create 237s -------------------------------- Fix snapshots --------------------------------- 237s +--------------------------------- test_a.py ----------------------------------+ 237s | @@ -2,5 +2,5 @@ | 237s | | 237s | from inline_snapshot import snapshot | 237s | | 237s | def test_a(): | 237s | - assert 1==snapshot(2) | 237s | + assert 1==snapshot(1) | 237s +------------------------------------------------------------------------------+ 237s These changes will be applied, because you used --inline-snapshot=fix\ 237s """ 237s ), 237s ) 237s 237s tests/test_pytest_plugin.py:626: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 237s assert normalize(report_str) == report, repr(report_str) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = "''" 237s filename = PosixPath('/tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: test_a.py 237s 237s from inline_snapshot import snapshot 237s 237s def test_a(): 237s assert 1==snapshot(2) 237s 237s 237s file: test_b.py 237s 237s from inline_snapshot import snapshot 237s 237s def test_b(): 237s assert 1==snapshot() 237s 237s 237s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmp69vbk566 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 2 items 237s 237s test_a.py F [ 50%] 237s test_b.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ____________________________________ test_a ____________________________________ 237s 237s def test_a(): 237s > assert 1==snapshot(2) 237s 237s test_a.py:5: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '1 ', filename = PosixPath('/tmp/tmp69vbk566/test_a.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ____________________________________ test_b ____________________________________ 237s 237s def test_b(): 237s > assert 1==snapshot() 237s 237s test_b.py:5: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '', filename = PosixPath('/tmp/tmp69vbk566/test_b.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 237s FAILED test_b.py::test_b - TypeError: CliRunner.__init__() got an unexpected ... 237s ============================== 2 failed in 0.21s =============================== 237s 237s stderr: 237s 237s ___________________ test_storage_dir_config[tests/snapshots] ___________________ 237s 237s project = .Project object at 0x3ff8c435cd0> 237s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_tests_0') 237s storage_dir = 'tests/snapshots' 237s 237s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 237s def test_storage_dir_config(project, tmp_path, storage_dir): 237s # Relative path case: `tests/snapshots` (parametrized). 237s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 237s if not storage_dir: 237s storage_dir = tmp_path / "snapshots" 237s 237s project.pyproject( 237s f""" 237s [tool.inline-snapshot] 237s storage-dir = "{storage_dir}" 237s """ 237s ) 237s 237s project.setup( 237s """ 237s from inline_snapshot import outsource, snapshot 237s 237s def test_outsource(): 237s assert outsource("hello", suffix=".html") == snapshot() 237s """ 237s ) 237s 237s result = project.run("--inline-snapshot=create") 237s > assert result.ret == 0 237s E assert == 0 237s E + where = .ret 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s 237s from inline_snapshot import outsource, snapshot 237s 237s def test_outsource(): 237s assert outsource("hello", suffix=".html") == snapshot() 237s 237s running: pytest --inline-snapshot=create 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 237s configfile: pyproject.toml 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ________________________________ test_outsource ________________________________ 237s 237s def test_outsource(): 237s > assert outsource("hello", suffix=".html") == snapshot() 237s 237s test_file.py:10: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 237s ============================== 1 failed in 0.31s =============================== 237s ________________________ test_storage_dir_config[None] _________________________ 237s 237s project = .Project object at 0x3ff8c4377a0> 237s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0') 237s storage_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0/snapshots') 237s 237s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 237s def test_storage_dir_config(project, tmp_path, storage_dir): 237s # Relative path case: `tests/snapshots` (parametrized). 237s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 237s if not storage_dir: 237s storage_dir = tmp_path / "snapshots" 237s 237s project.pyproject( 237s f""" 237s [tool.inline-snapshot] 237s storage-dir = "{storage_dir}" 237s """ 237s ) 237s 237s project.setup( 237s """ 237s from inline_snapshot import outsource, snapshot 237s 237s def test_outsource(): 237s assert outsource("hello", suffix=".html") == snapshot() 237s """ 237s ) 237s 237s result = project.run("--inline-snapshot=create") 237s > assert result.ret == 0 237s E assert == 0 237s E + where = .ret 237s 237s /tmp/autopkgtest.gRE7zS/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s write code: 237s # äöß 🐍 237s from inline_snapshot import snapshot 237s from inline_snapshot import outsource 237s 237s 237s 237s from inline_snapshot import outsource, snapshot 237s 237s def test_outsource(): 237s assert outsource("hello", suffix=".html") == snapshot() 237s 237s running: pytest --inline-snapshot=create 237s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 237s ============================= test session starts ============================== 237s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 237s configfile: pyproject.toml 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s test_file.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ________________________________ test_outsource ________________________________ 237s 237s def test_outsource(): 237s > assert outsource("hello", suffix=".html") == snapshot() 237s 237s test_file.py:10: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1/test_file.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 237s ============================== 1 failed in 0.38s =============================== 237s __________________ test_find_pyproject_in_parent_directories ___________________ 237s 237s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_find_pyproject_in_parent_0') 237s 237s def test_find_pyproject_in_parent_directories(tmp_path): 237s 237s Example( 237s { 237s "pyproject.toml": """\ 237s [tool.inline-snapshot] 237s hash-length=2 237s """, 237s "project/pytest.ini": "", 237s "project/test_something.py": """\ 237s from inline_snapshot import outsource,snapshot,external 237s 237s def test_something(): 237s assert outsource("test") == snapshot() 237s """, 237s } 237s > ).run_pytest( 237s ["--rootdir", "./project", "--inline-snapshot=create"], 237s changed_files=snapshot( 237s { 237s "project/test_something.py": """\ 237s from inline_snapshot import outsource,snapshot,external 237s 237s def test_something(): 237s assert outsource("test") == snapshot(external("9f*.txt")) 237s """ 237s } 237s ), 237s ) 237s 237s tests/test_pytest_plugin.py:790: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s self = 237s args = ['--rootdir', './project', '--inline-snapshot=create'] 237s 237s def run_pytest( 237s self, 237s args: list[str] = [], 237s *, 237s term_columns=80, 237s env: dict[str, str] = {}, 237s changed_files: Snapshot[dict[str, str]] | None = None, 237s report: Snapshot[str] | None = None, 237s stderr: Snapshot[str] | None = None, 237s returncode: Snapshot[int] | None = None, 237s ) -> Example: 237s """Run pytest with the given args and env variables in an seperate 237s process. 237s 237s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 237s 237s Parameters: 237s args: pytest arguments like "--inline-snapshot=fix" 237s env: dict of environment variables 237s changed_files: snapshot of files which are changed by this run. 237s report: snapshot of the report at the end of the pytest run. 237s stderr: pytest stderr output 237s returncode: snapshot of the pytest returncode. 237s 237s Returns: 237s A new Example instance which contains the changed files. 237s """ 237s 237s with TemporaryDirectory() as dir: 237s tmp_path = Path(dir) 237s self._write_files(tmp_path) 237s 237s cmd = [sys.executable, "-m", "pytest", *args] 237s 237s command_env = dict(os.environ) 237s command_env["TERM"] = "unknown" 237s command_env["COLUMNS"] = str( 237s term_columns + 1 if platform.system() == "Windows" else term_columns 237s ) 237s command_env.pop("CI", None) 237s 237s command_env.update(env) 237s 237s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 237s 237s print("run>", *cmd) 237s print("stdout:") 237s print(result.stdout.decode()) 237s print("stderr:") 237s print(result.stderr.decode()) 237s 237s if returncode is not None: 237s assert result.returncode == returncode 237s 237s if stderr is not None: 237s assert result.stderr.decode() == stderr 237s 237s if report is not None: 237s 237s report_list = [] 237s record = False 237s for line in result.stdout.decode().splitlines(): 237s line = line.strip() 237s if line.startswith("===="): 237s record = False 237s 237s if record and line: 237s report_list.append(line) 237s 237s if line.startswith("====") and "inline snapshot" in line: 237s record = True 237s 237s report_str = "\n".join(report_list) 237s 237s assert normalize(report_str) == report, repr(report_str) 237s 237s if changed_files is not None: 237s current_files = {} 237s 237s for name, content in sorted(self._read_files(tmp_path).items()): 237s if name not in self.files or self.files[name] != content: 237s current_files[name] = content 237s > assert changed_files == current_files 237s E assert {'project/tes...9f*.txt"))\n'} == {} 237s E 237s E Left contains 1 more item: 237s E {'project/test_something.py': 'from inline_snapshot import ' 237s E 'outsource,snapshot,external\n' 237s E '\n' 237s E 'def test_something():\n' 237s E ' assert outsource("test") == ' 237s E 'snapshot(external("9f*.txt"))\n'} 237s E Use -v to get more diff 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 237s ----------------------------- Captured stdout call ----------------------------- 237s file: pyproject.toml 237s [tool.inline-snapshot] 237s hash-length=2 237s 237s 237s file: project/pytest.ini 237s 237s 237s file: project/test_something.py 237s from inline_snapshot import outsource,snapshot,external 237s 237s def test_something(): 237s assert outsource("test") == snapshot() 237s 237s 237s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 237s stdout: 237s ============================= test session starts ============================== 237s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 237s rootdir: /tmp/tmpge6v95hb/project 237s configfile: ../pyproject.toml 237s plugins: subtests-0.13.1, mock-3.14.0, inline-snapshot-0.19.3, hypothesis-6.125.2, typeguard-4.4.1, time-machine-2.16.0, pytest_freezer-0.4.9 237s collected 1 item 237s 237s project/test_something.py F [100%] 237s 237s =================================== FAILURES =================================== 237s ________________________________ test_something ________________________________ 237s 237s def test_something(): 237s > assert outsource("test") == snapshot() 237s 237s project/test_something.py:4: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '', filename = PosixPath('/tmp/tmpge6v95hb/project/test_something.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s =============================== inline snapshot ================================ 237s =========================== short test summary info ============================ 237s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 237s ============================== 1 failed in 0.27s =============================== 237s 237s stderr: 237s 237s _________________________________ test_rewrite _________________________________ 237s 237s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0') 237s 237s def test_rewrite(tmp_path): 237s file = tmp_path / "file.txt" 237s file.write_text( 237s """ 237s 12345 237s 12345 237s 12345 237s """, 237s "utf-8", 237s ) 237s 237s with ChangeRecorder().activate() as recorder: 237s s = recorder.change_set() 237s 237s s.replace(((2, 2), (2, 3)), "a", filename=file) 237s s.delete(((3, 2), (3, 3)), filename=file) 237s s.insert((4, 2), "c", filename=file) 237s 237s assert recorder.num_fixes() == 1 237s > recorder.fix_all() 237s 237s tests/test_rewrite_code.py:43: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 237s file.rewrite() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 237s new_code = self.new_code() 237s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 237s format_whole_file = enforce_formatting() or code == format_code( 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '\n12345\n12345\n12345\n' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0/file.txt') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ______________________________ test_string_update ______________________________ 237s 237s check_update = .w at 0x3ff8c5b14e0> 237s 237s def test_string_update(check_update): 237s # black --preview wraps strings to keep the line length. 237s # string concatenation should produce updates. 237s assert ( 237s check_update( 237s 'assert "ab" == snapshot("a" "b")', reported_flags="", flags="update" 237s ) 237s == 'assert "ab" == snapshot("a" "b")' 237s ) 237s 237s assert ( 237s check_update( 237s 'assert "ab" == snapshot("a"\n "b")', reported_flags="", flags="update" 237s ) 237s == 'assert "ab" == snapshot("a"\n "b")' 237s ) 237s 237s > assert check_update( 237s 'assert "ab\\nc" == snapshot("a"\n "b\\nc")', flags="update" 237s ) == snapshot( 237s '''\ 237s assert "ab\\nc" == snapshot("""\\ 237s ab 237s c\\ 237s """)\ 237s ''' 237s ) 237s 237s tests/test_string.py:26: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:114: in run 237s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 237s /tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py:9: in 237s assert "ab\nc" == snapshot("a" 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 237s return self == other 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 237s self._changes.append(next(it)) 237s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 237s new_code = self.context.file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\nab\nc\\\n"""' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert "ab" == snapshot("a" "b") 237s reported_flags: set() 237s run: pytest --inline-snapshot= 237s output: 237s |assert "ab" == snapshot("a" "b") 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert "ab" == snapshot("a" "b") 237s reported_flags: set() 237s run: pytest --inline-snapshot=update 237s output: 237s |assert "ab" == snapshot("a" "b") 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert "ab" == snapshot("a" 237s | "b") 237s reported_flags: set() 237s run: pytest --inline-snapshot= 237s output: 237s |assert "ab" == snapshot("a" 237s | "b") 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert "ab" == snapshot("a" 237s | "b") 237s reported_flags: set() 237s run: pytest --inline-snapshot=update 237s output: 237s |assert "ab" == snapshot("a" 237s | "b") 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |assert "ab\nc" == snapshot("a" 237s | "b\nc") 237s _____________________________ test_string_newline ______________________________ 237s 237s check_update = .w at 0x3ff8c5b3ec0> 237s 237s def test_string_newline(check_update): 237s > assert check_update('s = snapshot("a\\nb")', flags="update") == snapshot( 237s '''\ 237s s = snapshot("""\\ 237s a 237s b\\ 237s """)\ 237s ''' 237s ) 237s 237s tests/test_string.py:46: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 237s yield from handle(self._ast_node, self._old_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\na\nb\\\n"""' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_newline0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot("a\nb") 237s ___________________________ test_string_quote_choice ___________________________ 237s 237s check_update = .w at 0x3ff8c47d9e0> 237s 237s def test_string_quote_choice(check_update): 237s > assert check_update( 237s "s = snapshot(\" \\'\\'\\' \\'\\'\\' \\\"\\\"\\\"\\nother_line\")", 237s flags="update", 237s ) == snapshot( 237s '''\ 237s s = snapshot("""\\ 237s \'\'\' \'\'\' \\"\\"\\" 237s other_line\\ 237s """)\ 237s ''' 237s ) 237s 237s tests/test_string.py:115: 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s tests/conftest.py:49: in w 237s s = source(source_code) 237s tests/conftest.py:158: in w 237s return Source(source=source).run() 237s tests/conftest.py:125: in run 237s changes += snapshot._changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 237s yield from self._value._get_changes() 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 237s yield from handle(self._ast_node, self._old_value) 237s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 237s new_code = self._file._token_to_code(new_token) 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 237s return self._format(tokenize.untokenize(tokens)).strip() 237s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 237s return format_code(text, Path(self._source.filename)) 237s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 237s 237s text = '"""\\\n \'\'\' \'\'\' \\"\\"\\"\nother_line\\\n"""' 237s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_quote_choice0/test_1.py') 237s 237s def format_code(text, filename): 237s if _config.config.format_command is not None: 237s format_command = _config.config.format_command.format(filename=filename) 237s result = sp.run( 237s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 237s ) 237s if result.returncode != 0: 237s raise_problem( 237s f"""\ 237s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 237s """ 237s + result.stdout.decode("utf-8") 237s + result.stderr.decode("utf-8") 237s ) 237s return text 237s return result.stdout.decode("utf-8") 237s 237s try: 237s from black import main 237s from click.testing import CliRunner 237s except ImportError: 237s raise_problem( 237s f"""\ 237s [b]inline-snapshot is not able to format your code.[/b] 237s This issue can be solved by: 237s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 237s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 237s """ 237s ) 237s return text 237s 237s with warnings.catch_warnings(): 237s warnings.simplefilter("ignore") 237s 237s > runner = CliRunner(mix_stderr=False) 237s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 237s 237s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 237s ----------------------------- Captured stdout call ----------------------------- 237s 237s input: 237s |""" 237s |PYTEST_DONT_REWRITE 237s |""" 237s |# äöß 🐍 237s |from inline_snapshot import snapshot 237s |from inline_snapshot import external 237s |from inline_snapshot import outsource 237s | 237s |s = snapshot(" \'\'\' \'\'\' \"\"\"\nother_line") 237s =============================== warnings summary =============================== 237s tests/adapter/test_sequence.py:64 237s /tmp/autopkgtest.gRE7zS/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 237s @pytest.mark.no_rewriting 237s 237s tests/test_inline_snapshot.py:17 237s /tmp/autopkgtest.gRE7zS/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 237s @pytest.mark.no_rewriting 237s 237s tests/test_inline_snapshot.py:24 237s /tmp/autopkgtest.gRE7zS/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 237s @pytest.mark.no_rewriting 237s 237s tests/test_pypy.py:8 237s /tmp/autopkgtest.gRE7zS/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 237s @pytest.mark.no_rewriting 237s 237s tests/test_pytest_plugin.py:275 237s /tmp/autopkgtest.gRE7zS/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 237s @pytest.mark.no_rewriting 237s 237s tests/test_pytest_plugin.py:501 237s /tmp/autopkgtest.gRE7zS/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 237s @pytest.mark.no_rewriting 237s 237s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 237s =============================== inline snapshot ================================ 237s Error: one snapshot has incorrect values (--inline-snapshot=fix) 237s 237s You can also use --inline-snapshot=review to approve the changes interactively 237s =========================== short test summary info ============================ 237s FAILED tests/adapter/test_dataclass.py::test_unmanaged - TypeError: CliRunner... 237s FAILED tests/adapter/test_dataclass.py::test_reeval - assert None == ('TypeEr... 237s FAILED tests/adapter/test_dataclass.py::test_dataclass_default_value - TypeEr... 237s FAILED tests/adapter/test_dataclass.py::test_attrs_default_value - AssertionE... 237s FAILED tests/adapter/test_dataclass.py::test_attrs_field_repr - AssertionErro... 237s FAILED tests/adapter/test_dataclass.py::test_disabled[executing] - TypeError:... 237s FAILED tests/adapter/test_dataclass.py::test_disabled[without-executing] - At... 237s FAILED tests/adapter/test_dataclass.py::test_add_argument - TypeError: CliRun... 237s FAILED tests/adapter/test_dataclass.py::test_remove_positional_argument - ass... 237s FAILED tests/adapter/test_dataclass.py::test_namedtuple - assert {'test_somet... 237s FAILED tests/adapter/test_dataclass.py::test_defaultdict - assert {'test_some... 237s FAILED tests/adapter/test_dataclass.py::test_dataclass_field_repr - assert No... 237s FAILED tests/adapter/test_dataclass.py::test_dataclass_var - assert None == (... 237s FAILED tests/adapter/test_dict.py::test_dict_var - assert None == ('TypeError... 237s FAILED tests/adapter/test_general.py::test_adapter_mismatch - assert None == ... 237s FAILED tests/adapter/test_sequence.py::test_list_adapter_create_inner_snapshot 237s FAILED tests/adapter/test_sequence.py::test_list_adapter_fix_inner_snapshot 237s FAILED tests/adapter/test_sequence.py::test_list_var - assert None == ('TypeE... 237s FAILED tests/test_change.py::test_change_function_args - TypeError: CliRunner... 237s FAILED tests/test_code_repr.py::test_enum - TypeError: CliRunner.__init__() g... 237s FAILED tests/test_code_repr.py::test_snapshot_generates_hasrepr - TypeError: ... 237s FAILED tests/test_code_repr.py::test_enum_in_dataclass - TypeError: CliRunner... 237s FAILED tests/test_code_repr.py::test_flag - TypeError: CliRunner.__init__() g... 237s FAILED tests/test_code_repr.py::test_type - TypeError: CliRunner.__init__() g... 237s FAILED tests/test_code_repr.py::test_qualname - assert None == ('TypeError:\n... 237s FAILED tests/test_code_repr.py::test_invalid_repr - TypeError: CliRunner.__in... 237s FAILED tests/test_config.py::test_config_pyproject - AssertionError: assert {... 237s FAILED tests/test_config.py::test_config_env - AssertionError: assert {'test_... 237s FAILED tests/test_config.py::test_shortcuts - AssertionError: assert {'test_a... 237s FAILED tests/test_config.py::test_default_shortcuts - AssertionError: assert ... 237s FAILED tests/test_dirty_equals.py::test_compare_dirty_equals_twice - assert N... 237s FAILED tests/test_dirty_equals.py::test_dirty_equals_with_changing_args - ass... 237s FAILED tests/test_example.py::test_example - AssertionError: assert [] == ['f... 237s FAILED tests/test_external.py::test_basic - TypeError: CliRunner.__init__() g... 237s FAILED tests/test_external.py::test_persist - TypeError: CliRunner.__init__()... 237s FAILED tests/test_external.py::test_pytest_compare_external - TypeError: CliR... 237s FAILED tests/test_external.py::test_pytest_compare_external_bytes - TypeError... 237s FAILED tests/test_external.py::test_pytest_existing_external_import - TypeErr... 237s FAILED tests/test_external.py::test_pytest_trim_external - TypeError: CliRunn... 237s FAILED tests/test_external.py::test_pytest_new_external - TypeError: CliRunne... 237s FAILED tests/test_external.py::test_pytest_config_hash_length - TypeError: Cl... 237s FAILED tests/test_external.py::test_no_imports - AssertionError: assert {'err... 237s FAILED tests/test_external.py::test_ensure_imports - TypeError: CliRunner.__i... 237s FAILED tests/test_external.py::test_ensure_imports_with_comment - TypeError: ... 237s FAILED tests/test_external.py::test_new_externals - TypeError: CliRunner.__in... 237s FAILED tests/test_formating.py::test_black_formatting_error - assert None == ... 237s FAILED tests/test_formating.py::test_fstring_139 - AssertionError: assert 1 == 0 237s [assert 4 == snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 == snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 == snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 == snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 == snapshot(2+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 == snapshot({0: 2+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 <= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 <= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 <= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 <= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 <= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 <= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 <= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 <= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 >= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 >= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 >= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 >= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 >= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 4 >= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 >= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 >= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot([4, 5])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot({0: [4, 5]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot([])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot({0: []})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot([3+2])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s [assert 5 in snapshot({0: [3+2]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(==)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(==)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(==)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(<=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(>=)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) create(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) trim(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) fix(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(in) update(in)] 237s FAILED tests/test_inline_snapshot.py::test_mutable_values - TypeError: CliRun... 237s FAILED tests/test_inline_snapshot.py::test_comparison - TypeError: CliRunner.... 237s FAILED tests/test_inline_snapshot.py::test_ge - TypeError: CliRunner.__init__... 237s FAILED tests/test_inline_snapshot.py::test_le - TypeError: CliRunner.__init__... 237s FAILED tests/test_inline_snapshot.py::test_contains - TypeError: CliRunner.__... 237s FAILED tests/test_inline_snapshot.py::test_getitem - TypeError: CliRunner.__i... 237s FAILED tests/test_inline_snapshot.py::test_assert - TypeError: CliRunner.__in... 237s FAILED tests/test_inline_snapshot.py::test_format_file - TypeError: CliRunner... 237s FAILED tests/test_inline_snapshot.py::test_format_value - TypeError: CliRunne... 237s FAILED tests/test_inline_snapshot.py::test_type_error - TypeError: CliRunner.... 237s FAILED tests/test_inline_snapshot.py::test_different_snapshot_name - TypeErro... 237s FAILED tests/test_inline_snapshot.py::test_quoting_change_is_no_update - Type... 237s FAILED tests/test_inline_snapshot.py::test_trailing_comma - TypeError: CliRun... 237s FAILED tests/test_inline_snapshot.py::test_is - assert None == ('TypeError:\n... 237s FAILED tests/test_is.py::test_missing_is - TypeError: CliRunner.__init__() go... 237s FAILED tests/test_is_normalized.py::test_repr - assert None == ('TypeError:\n... 237s FAILED tests/test_preserve_values.py::test_fix_list_fix - TypeError: CliRunne... 237s FAILED tests/test_preserve_values.py::test_fix_list_insert - TypeError: CliRu... 237s FAILED tests/test_preserve_values.py::test_fix_list_delete - TypeError: CliRu... 237s FAILED tests/test_preserve_values.py::test_fix_tuple_delete - TypeError: CliR... 237s FAILED tests/test_preserve_values.py::test_fix_dict_change - TypeError: CliRu... 237s FAILED tests/test_preserve_values.py::test_fix_dict_remove - TypeError: CliRu... 237s FAILED tests/test_preserve_values.py::test_fix_dict_insert - TypeError: CliRu... 237s FAILED tests/test_preserve_values.py::test_fix_dict_with_non_literal_keys - T... 237s FAILED tests/test_preserve_values.py::test_no_update_for_dirty_equals - TypeE... 237s FAILED tests/test_preserve_values.py::test_preserve_case_from_original_mr - T... 237s [[5, 5, 5] -> [] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 237s [[5, 5, 2+2] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 5, 3] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 237s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 237s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 2+2, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 2+2] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 2+2, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 2+2, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 3, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 3] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 3, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 3, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 237s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 237s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 237s [[] -> [8, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2] -> [8, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3] -> [8, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 5] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2] -> [8, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 2+2] -> [8, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 3] -> [8, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 5] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3] -> [8, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 2+2] -> [8, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 3] -> [8, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 5, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 5, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 5, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2] -> [4, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 2+2] -> [4, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 3] -> [4, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 2+2, 5] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 2+2] -> [4, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 2+2, 2+2] -> [4, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 2+2, 3] -> [4, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 3, 5] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 3] -> [4, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 3, 2+2] -> [4, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[2+2, 3, 3] -> [4, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 5, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 5, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 5, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3] -> [3, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 2+2] -> [3, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 3] -> [3, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 2+2, 5] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 2+2] -> [3, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 2+2, 2+2] -> [3, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 2+2, 3] -> [3, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 3, 5] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 3] -> [3, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [[3, 3, 2+2] -> [3, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 5, 5) -> () ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 237s [(5, 5, 2+2) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 5, 3) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 237s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 237s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 2+2, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 2+2) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 2+2, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 2+2, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 3, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 3) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 3, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 3, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 237s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 237s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 237s [() -> (8, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2,) -> (8, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3,) -> (8, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 5) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2,) -> (8, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 2+2) -> (8, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 3) -> (8, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 5) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3,) -> (8, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 2+2) -> (8, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 3) -> (8, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 5, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 5, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 5, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2,) -> (4, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 2+2) -> (4, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 3) -> (4, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 2+2, 5) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 2+2) -> (4, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 2+2, 2+2) -> (4, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 2+2, 3) -> (4, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 3, 5) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 3) -> (4, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 3, 2+2) -> (4, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(2+2, 3, 3) -> (4, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 5, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 5, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 5, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3,) -> (3, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 2+2) -> (3, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 3) -> (3, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 2+2, 5) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 2+2) -> (3, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 2+2, 2+2) -> (3, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 2+2, 3) -> (3, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 3, 5) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 3) -> (3, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [(3, 3, 2+2) -> (3, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 5, 2: 5} -> {} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 5} -> {2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 5, 2: 3} -> {2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 2: 5} -> {1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5} -> {1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 2: 3} -> {1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 3, 2: 5} -> {1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 3} -> {1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 5, 2: 5} -> {0: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 5} -> {0: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 5, 2: 3} -> {0: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{2: 5} -> {0: 8, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{} -> {0: 8, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{2: 3} -> {0: 8, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 3, 2: 5} -> {0: 8, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 3} -> {0: 8, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 5, 2: 5} -> {0: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 5} -> {0: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 2: 5} -> {0: 3, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3} -> {0: 3, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 237s FAILED tests/test_pydantic.py::test_pydantic_create_snapshot - AssertionError... 237s FAILED tests/test_pydantic.py::test_pydantic_field_repr - AssertionError: ass... 237s FAILED tests/test_pydantic.py::test_pydantic_default_value - AssertionError: ... 237s FAILED tests/test_pydantic.py::test_pydantic_factory_method - AssertionError:... 237s FAILED tests/test_pypy.py::test_pypy - TypeError: CliRunner.__init__() got an... 237s FAILED tests/test_pytest_plugin.py::test_create - AssertionError: assert {'er... 237s FAILED tests/test_pytest_plugin.py::test_fix - AssertionError: assert {'error... 237s FAILED tests/test_pytest_plugin.py::test_update - AssertionError: assert {'er... 237s FAILED tests/test_pytest_plugin.py::test_trim - TypeError: CliRunner.__init__... 237s FAILED tests/test_pytest_plugin.py::test_multiple - AssertionError: assert {'... 237s FAILED tests/test_pytest_plugin.py::test_multiple_report - TypeError: CliRunn... 237s FAILED tests/test_pytest_plugin.py::test_black_config - TypeError: CliRunner.... 237s FAILED tests/test_pytest_plugin.py::test_disabled - TypeError: CliRunner.__in... 237s FAILED tests/test_pytest_plugin.py::test_compare - TypeError: CliRunner.__ini... 237s FAILED tests/test_pytest_plugin.py::test_assertion_error_loop - TypeError: Cl... 237s FAILED tests/test_pytest_plugin.py::test_assertion_error - TypeError: CliRunn... 237s FAILED tests/test_pytest_plugin.py::test_pytest_inlinesnapshot_auto - TypeErr... 237s FAILED tests/test_pytest_plugin.py::test_persist_unknown_external - TypeError... 237s FAILED tests/test_pytest_plugin.py::test_diff_multiple_files - TypeError: Cli... 237s FAILED tests/test_pytest_plugin.py::test_storage_dir_config[tests/snapshots] 237s 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 423s autopkgtest [04:35:56]: test autodep8-python3: [----------------------- 423s Testing with python3.12: 423s 423s Testing with python3.13: 423s 424s autopkgtest [04:35:57]: test autodep8-python3: -----------------------] 424s autopkgtest [04:35:57]: test autodep8-python3: - - - - - - - - - - results - - - - - - - - - - 424s autodep8-python3 PASS (superficial) 424s autopkgtest [04:35:57]: @@@@@@@@@@@@@@@@@@@@ summary 424s upstream-tests FAIL non-zero exit status 1 424s autodep8-python3 PASS (superficial) 442s nova [W] Using flock in prodstack6-s390x 442s Creating nova instance adt-plucky-s390x-python-inline-snapshot-20250219-042852-juju-7f2275-prod-proposed-migration-environment-20-0662d63a-310f-42f7-9cf7-a926d48007b3 from image adt/ubuntu-plucky-s390x-server-20250218.img (UUID d4b3949f-1d31-4fe6-9e99-080adec067af)... 442s nova [W] Timed out waiting for a400419c-13e5-4e2f-8118-a6057737ad8e to get deleted. 442s nova [W] Using flock in prodstack6-s390x 442s Creating nova instance adt-plucky-s390x-python-inline-snapshot-20250219-042852-juju-7f2275-prod-proposed-migration-environment-20-0662d63a-310f-42f7-9cf7-a926d48007b3 from image adt/ubuntu-plucky-s390x-server-20250218.img (UUID d4b3949f-1d31-4fe6-9e99-080adec067af)... 442s nova [W] Timed out waiting for d08dc67e-426a-4cd9-b53a-e425b9bc8ab3 to get deleted.